Coalesce null activity name in ActivityPub\Processor

- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1338133783
This commit is contained in:
Hypolite Petovan 2022-12-07 22:10:38 -05:00
parent e7574356d8
commit 1622ce0a99

View File

@ -804,7 +804,7 @@ class Processor
private static function processContent(array $activity, array $item) private static function processContent(array $activity, array $item)
{ {
if (!empty($activity['mediatype']) && ($activity['mediatype'] == 'text/markdown')) { if (!empty($activity['mediatype']) && ($activity['mediatype'] == 'text/markdown')) {
$item['title'] = strip_tags($activity['name']); $item['title'] = strip_tags($activity['name'] ?? '');
$content = Markdown::toBBCode($activity['content']); $content = Markdown::toBBCode($activity['content']);
} elseif (!empty($activity['mediatype']) && ($activity['mediatype'] == 'text/bbcode')) { } elseif (!empty($activity['mediatype']) && ($activity['mediatype'] == 'text/bbcode')) {
$item['title'] = $activity['name']; $item['title'] = $activity['name'];