From 7814ba4fc4be52c3bb387527be1df8fb659d6628 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 16 Jun 2022 14:21:11 +0200 Subject: [PATCH] Fixes for bad invocations of HTML::toBBCode() (1st parameter is now string) --- src/Protocol/ActivityPub/Processor.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 31a37a36f1..077ba3e3fe 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -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') ?? []); -- 2.39.5