X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FDiaspora.php;h=586b6e9ec282e8b425adfbf42adff5a71d995bcc;hb=7155f825daf90f4113ba3e8755eb51898b8e5736;hp=36c97cdea0570d2dc6051947bf3165f9908b7d87;hpb=639d5373e08d80387442f873e22960c8633d41c6;p=friendica.git diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 36c97cdea0..586b6e9ec2 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -2870,9 +2870,9 @@ class Diaspora return false; } - $aes_key = openssl_random_pseudo_bytes(32); + $aes_key = random_bytes(32); $b_aes_key = base64_encode($aes_key); - $iv = openssl_random_pseudo_bytes(16); + $iv = random_bytes(16); $b_iv = base64_encode($iv); $ciphertext = self::aesEncrypt($aes_key, $iv, $msg); @@ -3406,7 +3406,7 @@ class Diaspora $type = "reshare"; } else { $title = $item["title"]; - $body = Post\Media::addAttachmentsToBody($item['uri-id']); + $body = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); // Fetch the title from an attached link - if there is one if (empty($item["title"]) && DI::pConfig()->get($owner['uid'], 'system', 'attach_link_title')) { @@ -3620,7 +3620,7 @@ class Diaspora $thread_parent_item = Post::selectFirst(['guid', 'author-id', 'author-link', 'gravity'], ['uri' => $item['thr-parent'], 'uid' => $item['uid']]); } - $body = Post\Media::addAttachmentsToBody($item['uri-id']); + $body = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); // The replied to autor mention is prepended for clarity if: // - Item replied isn't yours @@ -4049,13 +4049,11 @@ class Diaspora return false; } - $parent = Post::selectFirst(['parent-uri'], ['uri' => $item['thr-parent']]); - if (!DBA::isResult($parent)) { - return; + // This is only needed for the automated tests + if (empty($owner['uprvkey'])) { + return false; } - $item['parent-uri'] = $parent['parent-uri']; - $message = self::constructComment($item, $owner); if ($message === false) { return false;