aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Daemon/Onepoll.php5
-rw-r--r--Zotlabs/Lib/Crypto.php3
-rw-r--r--include/message.php32
-rw-r--r--include/oembed.php5
-rw-r--r--include/zot.php1
5 files changed, 25 insertions, 21 deletions
diff --git a/Zotlabs/Daemon/Onepoll.php b/Zotlabs/Daemon/Onepoll.php
index 2200276e0..85394c8d0 100644
--- a/Zotlabs/Daemon/Onepoll.php
+++ b/Zotlabs/Daemon/Onepoll.php
@@ -24,7 +24,7 @@ class Onepoll {
}
$contacts = q("SELECT abook.*, xchan.*, account.*
- FROM abook LEFT JOIN account on abook_account = account_id left join xchan on xchan_hash = abook_xchan
+ FROM abook LEFT JOIN account on abook_account = account_id left join xchan on xchan_hash = abook_xchan
where abook_id = %d
and abook_pending = 0 and abook_archived = 0 and abook_blocked = 0 and abook_ignored = 0
AND (( account_flags = %d ) OR ( account_flags = %d )) limit 1",
@@ -52,7 +52,6 @@ class Onepoll {
logger("onepoll: poll: ({$contact['id']}) IMPORTER: {$importer['xchan_name']}, CONTACT: {$contact['xchan_name']}");
- // TODO: unused
$last_update = ((($contact['abook_updated'] === $contact['abook_created']) || ($contact['abook_updated'] <= NULL_DATE))
? datetime_convert('UTC', 'UTC', 'now - 7 days')
: datetime_convert('UTC', 'UTC', $contact['abook_updated'] . ' - 2 days')
@@ -120,7 +119,7 @@ class Onepoll {
if (!$can_send_stream)
$fetch_feed = false;
- if ($fetch_feed) {
+ if ($fetch_feed && $contact['xchan_network'] !== 'zot') {
$max = intval(get_config('system', 'max_imported_posts', 30));
diff --git a/Zotlabs/Lib/Crypto.php b/Zotlabs/Lib/Crypto.php
index 7c4654ec0..f1794ae64 100644
--- a/Zotlabs/Lib/Crypto.php
+++ b/Zotlabs/Lib/Crypto.php
@@ -12,7 +12,8 @@ class Crypto {
['aes256ctr', 'aes-256-ctr', 32, 16],
['camellia256cfb', 'camellia-256-cfb', 32, 16],
- ['cast5cfb', 'cast5-cfb', 16, 8]
+ ['cast5cfb', 'cast5-cfb', 16, 8],
+ ['aes256cbc', 'aes-256-cbc', 32, 16] // remove after legacy zot has been sunset
];
diff --git a/include/message.php b/include/message.php
index 37fe6749d..e6c9ed8ee 100644
--- a/include/message.php
+++ b/include/message.php
@@ -17,9 +17,9 @@ function mail_prepare_binary($item) {
// send a private message
-
-function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $replyto = '', $expires = NULL_DATE, $mimetype = 'text/bbcode', $raw = false, $sig = '') {
+
+function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $replyto = '', $expires = NULL_DATE, $mimetype = 'text/bbcode', $raw = false, $sig = '') {
$ret = array('success' => false);
$is_reply = false;
@@ -80,7 +80,7 @@ function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $rep
$ret['message'] = t('No recipient provided.');
return $ret;
}
-
+
if(! strlen($subject))
$subject = t('[no subject]');
@@ -99,13 +99,13 @@ function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $rep
if($r) {
$conv_guid = $r[0]['conv_guid'];
}
- }
+ }
if(! $conv_guid) {
// create a new conversation
- $retconv = create_conversation($channel,$recipient,$subject);
+ $retconv = create_conversation($channel,$recipient,$subject);
if($retconv) {
$conv_guid = $retconv['guid'];
}
@@ -153,7 +153,7 @@ function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $rep
/**
*
- * When a photo was uploaded into the message using the (profile wall) ajax
+ * When a photo was uploaded into the message using the (profile wall) ajax
* uploader, The permissions are initially set to disallow anybody but the
* owner from seeing it. This is because the permissions may not yet have been
* set for the post. If it's private, the photo permissions should be set
@@ -232,7 +232,7 @@ function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $rep
dbesc($image_uri),
intval($channel['channel_id']),
dbesc('<' . $channel['channel_hash'] . '>')
- );
+ );
}
}
@@ -293,7 +293,7 @@ function create_conversation($channel,$recipient,$subject) {
dbesc($conv_guid),
intval($channel['channel_id'])
);
-
+
return $r[0];
}
@@ -308,11 +308,12 @@ function private_messages_list($uid, $mailbox = '', $start = 0, $numitems = 0) {
if($numitems)
$limit = " LIMIT " . intval($numitems) . " OFFSET " . intval($start);
-
+
if($mailbox !== '') {
$x = q("select channel_hash from channel where channel_id = %d limit 1",
intval($uid)
);
+
if(! $x)
return array();
@@ -332,10 +333,9 @@ function private_messages_list($uid, $mailbox = '', $start = 0, $numitems = 0) {
case 'combined':
default:
$parents = q("SELECT mail.parent_mid FROM mail LEFT JOIN conv ON mail.conv_guid = conv.guid WHERE mail.mid = mail.parent_mid AND mail.channel_id = %d ORDER BY conv.updated DESC $limit",
- dbesc($local_channel)
+ intval($local_channel)
);
break;
-
}
}
@@ -346,7 +346,7 @@ function private_messages_list($uid, $mailbox = '', $start = 0, $numitems = 0) {
foreach($parents as $parent) {
$all = q("SELECT * FROM mail WHERE parent_mid = '%s' AND channel_id = %d ORDER BY created DESC limit 1",
dbesc($parent['parent_mid']),
- dbesc($local_channel)
+ intval($local_channel)
);
if($all) {
@@ -356,7 +356,7 @@ function private_messages_list($uid, $mailbox = '', $start = 0, $numitems = 0) {
}
}
}
- else {
+ elseif($sql) {
$r = q($sql);
}
@@ -477,7 +477,7 @@ function private_messages_drop($channel_id, $messageitem_id, $drop_conversation
dbesc($x[0]['conv_guid']),
intval($channel_id)
);
- }
+ }
$m['mail'] = array();
foreach($z as $zz) {
xchan_mail_query($zz);
@@ -513,7 +513,7 @@ function private_messages_fetch_conversation($channel_id, $messageitem_id, $upda
intval($messageitem_id)
);
- if(! $r)
+ if(! $r)
return array();
$messages = q("select * from mail where parent_mid = '%s' and channel_id = %d order by created asc",
@@ -559,7 +559,7 @@ function private_messages_fetch_conversation($channel_id, $messageitem_id, $upda
intval($channel_id)
);
}
-
+
return $messages;
}
diff --git a/include/oembed.php b/include/oembed.php
index b6060c878..01cd8945f 100644
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -433,9 +433,12 @@ function oembed_html2bbcode($text) {
$html_text = mb_convert_encoding($text, 'HTML-ENTITIES', mb_detect_encoding($text));
// If it doesn't parse at all, just return the text.
- $dom = @DOMDocument::loadHTML($html_text);
+
+ $dom = new DOMDocument;
+ @$dom->loadHTML($html_text);
if(! $dom)
return $text;
+
$xpath = new DOMXPath($dom);
$attr = "oembed";
diff --git a/include/zot.php b/include/zot.php
index e68da4209..84bf3f9b2 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -464,6 +464,7 @@ function zot_refresh($them, $channel = null, $force = false) {
if($j['permissions']['data']) {
$permissions = Crypto::unencapsulate(
[
+ 'encrypted' => true,
'data' => $j['permissions']['data'],
'key' => $j['permissions']['key'],
'iv' => $j['permissions']['iv'],