From 71e58a0f424b06b22e2ab1257e03809c4653c131 Mon Sep 17 00:00:00 2001 From: Peter Liebetrau Date: Fri, 25 Jan 2019 16:56:28 +0100 Subject: [PATCH] BBCode - optimized preg escaping of searchstring --- src/Content/Text/BBCode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 0818e28b1a..b436fb20ec 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1363,7 +1363,7 @@ class BBCode extends BaseObject // We need no target="_blank" for local links // convert links start with System::baseUrl() as local link without the target="_blank" attribute - $escapedBaseUrl = str_replace('://', '\:\/\/', System::baseUrl()); + $escapedBaseUrl = preg_quote(System::baseUrl(), '/'); $text = preg_replace("/\[url\]($escapedBaseUrl)([$URLSearchString]*)\[\/url\]/ism", '$1$2', $text); $text = preg_replace("/\[url\=($escapedBaseUrl)([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$3', $text); -- 2.39.5