]> git.mxchange.org Git - friendica.git/commitdiff
Ensure Tag::getByURIId parameter value in OStatus;;entryFooter
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 4 May 2020 22:51:03 +0000 (18:51 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 4 May 2020 22:51:03 +0000 (18:51 -0400)
- 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

index 8ab14c07816eae6db6626a624a251dee9fa38127..cff50f08e0a27c4ffaef6d1bf61dcc6ba448af29 100644 (file)
@@ -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)