X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FItem.php;h=bb8080e5fd4f234623d5e90af64b6cb0a9a6df6d;hb=8446de2aa6961b585ea2e886ea133e95278629e4;hp=5144e73e0e83f5360467fe7502424407298b4e68;hpb=4fb03cf1632dd41a91cbfdf70207fd253fb7f9d2;p=friendica.git diff --git a/src/Model/Item.php b/src/Model/Item.php index 5144e73e0e..bb8080e5fd 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1830,11 +1830,11 @@ class Item * Posts that are created on this system are using System::createUUID. * Received ActivityPub posts are using Processor::getGUIDByURL. * - * @param string $uri uri of an item entry - * @param string $host hostname for the GUID prefix - * @return string unique guid + * @param string $uri uri of an item entry + * @param string|null $host hostname for the GUID prefix + * @return string Unique guid */ - public static function guidFromUri(string $uri, string $host): string + public static function guidFromUri(string $uri, string $host = null): string { // Our regular guid routine is using this kind of prefix as well // We have to avoid that different routines could accidentally create the same value @@ -2831,7 +2831,8 @@ class Item $shared_uri_id = 0; $shared_links = []; } - $attachments = Post\Media::splitAttachments($item['uri-id'], $item['guid'] ?? '', $shared_links, $item['has-media']); + + $attachments = Post\Media::splitAttachments($item['uri-id'], $item['guid'] ?? '', $shared_links, $item['has-media'] ?? false); $item['body'] = self::replaceVisualAttachments($attachments, $item['body'] ?? ''); $item['body'] = preg_replace("/\s*\[attachment .*?\].*?\[\/attachment\]\s*/ism", "\n", $item['body']);