]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Feed.php
Avoid local network communication / invalid url requests
[friendica.git] / src / Protocol / Feed.php
index dec463820d89507b33891087f711be5bbbcd7f8f..0abd49c4627e7e234114f152066ee5f103086332 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -376,11 +376,11 @@ class Feed
                        }
 
                        if ($published != '') {
-                               $item['created'] = $published;
+                               $item['created'] = trim($published);
                        }
 
                        if ($updated != '') {
-                               $item['edited'] = $updated;
+                               $item['edited'] = trim($updated);
                        }
 
                        if (!$dryRun) {
@@ -624,6 +624,7 @@ class Feed
                        Logger::info('Stored feed', ['item' => $item]);
 
                        $notify = Item::isRemoteSelf($contact, $item);
+                       $item['wall'] = (bool)$notify;
 
                        // Distributed items should have a well-formatted URI.
                        // Additionally, we have to avoid conflicts with identical URI between imported feeds and these items.
@@ -1121,7 +1122,7 @@ 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 = BBCode::convertForUriId($item['uri-id'], $body, BBCode::ACTIVITYPUB);