From b6257975919209371a59f5fbc1b13e74899a37c5 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 16 May 2020 18:38:50 +0000 Subject: [PATCH] issue 8642: Make hashtags more compatible --- src/Content/Text/BBCode.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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 -- 2.39.5