From: peter Date: Fri, 25 Jan 2019 14:32:31 +0000 (+0100) Subject: BBCode - removed convert for relative URLs X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6ba08e510d1be9f56ca21bbf26d68d6417aa5882;p=friendica.git BBCode - removed convert for relative URLs --- 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);