From 6ba08e510d1be9f56ca21bbf26d68d6417aa5882 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 25 Jan 2019 15:32:31 +0100 Subject: [PATCH] BBCode - removed convert for relative URLs --- src/Content/Text/BBCode.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index b710dc13ec..0818e28b1a 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1362,13 +1362,10 @@ class BBCode extends BaseObject }, $text); // We need no target="_blank" for local links - // convert links start with System::baseUrl() as local link + // convert links start with System::baseUrl() as local link without the target="_blank" attribute $escapedBaseUrl = str_replace('://', '\:\/\/', System::baseUrl()); $text = preg_replace("/\[url\]($escapedBaseUrl)([$URLSearchString]*)\[\/url\]/ism", '$1$2', $text); $text = preg_replace("/\[url\=($escapedBaseUrl)([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$3', $text); - // convert links that start with / as local link - $text = preg_replace("/\[url\](\/[$URLSearchString]*)\[\/url\]/ism", '$1', $text); - $text = preg_replace("/\[url\=(\/[$URLSearchString]*)\](.*?)\[\/url\]/ism", '$2', $text); $text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/ism", '$1', $text); $text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$2', $text);