diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php
index 0818e28b1..b436fb20e 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);