From 340bc57952ca10a3c454576a7914f5f6ad41056d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 4 May 2020 18:51:03 -0400 Subject: [PATCH] Ensure Tag::getByURIId parameter value in OStatus;;entryFooter - Address https://github.com/friendica/friendica/issues/8473#issuecomment-623701081 - $item['uri-id'] isn't present for follow entry pseudo-items --- src/Protocol/OStatus.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index 8ab14c0781..cff50f08e0 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -2081,11 +2081,9 @@ class OStatus XML::addElement($doc, $entry, "ostatus:conversation", $conversation_uri, $attributes); } - $tags = Tag::getByURIId($item['uri-id']); - if (count($tags)) { - foreach ($tags as $tag) { - $mentioned[$tag['url']] = $tag['url']; - } + // uri-id isn't present for follow entry pseudo-items + foreach (Tag::getByURIId($item['uri-id'] ?? 0) as $tag) { + $mentioned[$tag['url']] = $tag['url']; } // Make sure that mentions are accepted (GNU Social has problems with mixing HTTP and HTTPS) -- 2.39.5