]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Item.php
Merge pull request #11913 from tobiasd/2022.09-CHANGELOG
[friendica.git] / src / Content / Item.php
index 1b07c5585cd3fa578f5450986ee62e17e836afe5..6cbcb636955f58446e6273e703a946995c6b0147 100644 (file)
@@ -656,8 +656,12 @@ class Item
         */
        public function createSharedBlockByArray(array $item): string
        {
-               if (!in_array($item['network'] ?? '', Protocol::FEDERATED)) {
+               if ($item['network'] == Protocol::FEED) {
+                       return PageInfo::getFooterFromUrl($item['plink']);
+               } elseif (!in_array($item['network'] ?? '', Protocol::FEDERATED)) {
+                       $item['guid'] = '';
                        $item['uri']  = '';
+                       $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']);
                }
 
                $shared_content = BBCode::getShareOpeningTag($item['author-name'], $item['author-link'], $item['author-avatar'], $item['plink'], $item['created'], $item['guid'], $item['uri']);
@@ -668,14 +672,12 @@ class Item
 
                $shared = BBCode::fetchShareAttributes($item['body']);
 
-               $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']);
-
                // If it is a reshared post then reformat it to avoid display problems with two share elements
                if (Diaspora::isReshare($item['body'], false)) {
                        if (!empty($shared['guid']) && ($encaspulated_share = self::createSharedPostByGuid($shared['guid']))) {
                                $item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encaspulated_share, $item['body']);
                        }
-       
+
                        $item['body'] = HTML::toBBCode(BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::ACTIVITYPUB));
                }