From 3a4345aecaf9735c6c6b9692a9fa577a01c11ebf Mon Sep 17 00:00:00 2001 From: Roardom Date: Tue, 21 Jan 2025 10:34:18 +0000 Subject: [PATCH] fix: double escape in link content We already escape the entire content and don't need to escape the link content a second time. Otherwise, when a link contains, for example, an apostrophe, it's double encoded to `&pos;` before being displayed on the page. Regression from #3222 --- app/Helpers/Bbcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Helpers/Bbcode.php b/app/Helpers/Bbcode.php index 2a2ba1bae9..78ce2c26eb 100755 --- a/app/Helpers/Bbcode.php +++ b/app/Helpers/Bbcode.php @@ -291,7 +291,7 @@ public function parse(?string $source, bool $replaceLineBreaks = true): string ); $source = preg_replace_callback( '/\[url=(.*?)](.*?)\[\/url]/i', - fn ($matches) => ''.e($matches[2]).'', + fn ($matches) => ''.$matches[2].'', $source ?? '' ); $source = preg_replace_callback(