X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FActivityPub%2FProcessor.php;h=47a5300352d03ee73104ad05290d4f134c4035b8;hb=1de159a2ae44b162524ec0f6ccb3dfedaccb2468;hp=790a933bb03925c32db92ad14aecd57eafbf8618;hpb=4b36f7e8c8f36a9aef35067b108a85f4733f9535;p=friendica.git diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 790a933bb0..47a5300352 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -1207,20 +1207,24 @@ class Processor // This prevents links to be added again to Pleroma-style mention links $body = self::normalizeMentionLinks($body); - foreach ($tags as $tag) { - if (empty($tag['name']) || empty($tag['type']) || empty($tag['href']) || !in_array($tag['type'], ['Mention', 'Hashtag'])) { - continue; - } + $body = BBCode::performWithEscapedTags($body, ['url'], function ($body) use ($tags) { + foreach ($tags as $tag) { + if (empty($tag['name']) || empty($tag['type']) || empty($tag['href']) || !in_array($tag['type'], ['Mention', 'Hashtag'])) { + continue; + } - $hash = substr($tag['name'], 0, 1); - $name = substr($tag['name'], 1); - if (!in_array($hash, Tag::TAG_CHARACTER)) { - $hash = ''; - $name = $tag['name']; + $hash = substr($tag['name'], 0, 1); + $name = substr($tag['name'], 1); + if (!in_array($hash, Tag::TAG_CHARACTER)) { + $hash = ''; + $name = $tag['name']; + } + + $body = str_replace($tag['name'], $hash . '[url=' . $tag['href'] . ']' . $name . '[/url]', $body); } - $body = str_replace($tag['name'], $hash . '[url=' . $tag['href'] . ']' . $name . '[/url]', $body); - } + return $body; + }); return $body; }