X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FDiaspora.php;h=00da7d3915d2dd68d0f7c6013af0472c5f4b3c8e;hb=e7884b14092b5f5f2c5656d622a625006bffb165;hp=2a4dfe75e7e516a1aaee9a88106a33af26ea9ea3;hpb=8685e5ca329f9d22d5607df4b6e5f746e3abbc81;p=friendica.git diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 2a4dfe75e7..00da7d3915 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -2485,7 +2485,6 @@ class Diaspora Tag::storeFromBody($datarray['uri-id'], $datarray["body"]); - //Post\Media::copy($original_item['uri-id'], $datarray['uri-id']); $datarray["app"] = $original_item["app"]; $datarray["plink"] = self::plink($author, $guid); @@ -2729,8 +2728,6 @@ class Diaspora if ($data->photo) { foreach ($data->photo as $photo) { self::storePhotoAsMedia($datarray['uri-id'], $photo); - //$body = "[img]".XML::unescape($photo->remote_photo_path). - // XML::unescape($photo->remote_photo_name)."[/img]\n".$body; } $datarray["object-type"] = Activity\ObjectType::IMAGE; @@ -2873,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); @@ -3409,7 +3406,7 @@ class Diaspora $type = "reshare"; } else { $title = $item["title"]; - $body = $item["body"]; + $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')) { @@ -3623,7 +3620,7 @@ class Diaspora $thread_parent_item = Post::selectFirst(['guid', 'author-id', 'author-link', 'gravity'], ['uri' => $item['thr-parent'], 'uid' => $item['uid']]); } - $body = $item["body"]; + $body = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); // The replied to autor mention is prepended for clarity if: // - Item replied isn't yours