]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Feed.php
Fix missing attached links in posts
[friendica.git] / src / Protocol / Feed.php
index be58b9aa8ffa504cf587bc5059beee990efb0bf7..cbffd810c1d03b444faeedac9cd9ae201b2d623c 100644 (file)
@@ -629,8 +629,9 @@ class Feed
                        // Distributed items should have a well-formatted URI.
                        // Additionally, we have to avoid conflicts with identical URI between imported feeds and these items.
                        if ($notify) {
-                               $item['guid'] = Item::guidFromUri($orig_plink, DI::baseUrl()->getHostname());
-                               $item['uri'] = Item::newURI($item['guid']);
+                               $item['guid'] = Item::guidFromUri($orig_plink, DI::baseUrl()->getHost());
+                               $item['uri']  = Item::newURI($item['guid']);
+                               unset($item['plink']);
                                unset($item['thr-parent']);
                                unset($item['parent-uri']);
 
@@ -1122,7 +1123,8 @@ class Feed
                XML::addElement($doc, $entry, 'id', $item['uri']);
                XML::addElement($doc, $entry, 'title', html_entity_decode($title, ENT_QUOTES, 'UTF-8'));
 
-               $body = OStatus::formatPicturePost($item['body'], $item['uri-id']);
+               $body = Post\Media::addAttachmentsToBody($item['uri-id'], DI::contentItem()->addSharedPost($item));
+               $body = Post\Media::addHTMLAttachmentToBody($item['uri-id'], $body);
 
                $body = BBCode::convertForUriId($item['uri-id'], $body, BBCode::ACTIVITYPUB);