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
This commit is contained in:
Roardom
2025-01-21 10:34:18 +00:00
parent 90d2741605
commit 3a4345aeca
+1 -1
View File
@@ -291,7 +291,7 @@ class Bbcode
);
$source = preg_replace_callback(
'/\[url=(.*?)](.*?)\[\/url]/i',
fn ($matches) => '<a href="'.$this->sanitizeUrl($matches[1]).'">'.e($matches[2]).'</a>',
fn ($matches) => '<a href="'.$this->sanitizeUrl($matches[1]).'">'.$matches[2].'</a>',
$source ?? ''
);
$source = preg_replace_callback(