]> git.mxchange.org Git - friendica.git/commitdiff
Fixes for bad invocations of HTML::toBBCode() (1st parameter is now string)
authorRoland Häder <roland@mxchange.org>
Thu, 16 Jun 2022 12:21:11 +0000 (14:21 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 16 Jun 2022 14:54:50 +0000 (16:54 +0200)
src/Protocol/ActivityPub/Processor.php

index 31a37a36f1adbdd25c718ec2b072f73ed46225e6..077ba3e3fe9f75ce940b2b2d3fa142ea0967decf 100644 (file)
@@ -651,7 +651,7 @@ class Processor
 
                                $content = self::removeImplicitMentionsFromBody($content, $parent);
                        }
-                       $item['content-warning'] = HTML::toBBCode($activity['summary']);
+                       $item['content-warning'] = (!empty($activity['summary']) ? HTML::toBBCode($activity['summary']) : '');
                        $item['raw-body'] = $item['body'] = $content;
                }
 
@@ -1225,7 +1225,8 @@ class Processor
                $attributed_to = JsonLD::fetchElement($activity['as:object'], 'as:attributedTo', '@id');
                $authorid = Contact::getIdForURL($attributed_to);
 
-               $body = HTML::toBBCode(JsonLD::fetchElement($activity['as:object'], 'as:content', '@value'));
+               $value = JsonLD::fetchElement($activity['as:object'], 'as:content', '@value');
+               $body = (!empty($value) ? HTML::toBBCode($value) : '');
 
                $messageTags = [];
                $tags = Receiver::processTags(JsonLD::fetchElementArray($activity['as:object'], 'as:tag') ?? []);