diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 61b71743cb..98c1552930 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1801,12 +1801,16 @@ class BBCode * - #[url=][/url] * - [url=]#[/url] */ - $text = preg_replace_callback("/(?:#\[url\=[^\[\]]*\]|\[url\=[^\[\]]*\]#)(.*?)\[\/url\]/ism", function($matches) { - return '#'; + $text = preg_replace_callback("/(?:#\[url\=[^\[\]]*\]|\[url\=[^\[\]]*\]#)(.*?)\[\/url\]/ism", function($matches) use ($simple_html) { + if ($simple_html == BBCode::ACTIVITYPUB) { + return '#' + . XML::escape($matches[1]) . ''; + } else { + return '#'; + } }, $text); // We need no target="_blank" rel="noopener noreferrer" for local links