]> git.mxchange.org Git - friendica.git/commitdiff
BBCode - removed convert for relative URLs
authorpeter <peter@jean-luc-picard>
Fri, 25 Jan 2019 14:32:31 +0000 (15:32 +0100)
committerpeter <peter@jean-luc-picard>
Fri, 25 Jan 2019 14:32:31 +0000 (15:32 +0100)
src/Content/Text/BBCode.php

index b710dc13ec3640e2c830325f57612ba4c1d9052d..0818e28b1ae0c3350d507712a9656dbd73470761 100644 (file)
@@ -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", '<a href="$1$2">$1$2</a>', $text);
                $text = preg_replace("/\[url\=($escapedBaseUrl)([$URLSearchString]*)\](.*?)\[\/url\]/ism", '<a href="$1$2">$3</a>', $text);             
-               // convert links that start with / as local link
-               $text = preg_replace("/\[url\](\/[$URLSearchString]*)\[\/url\]/ism", '<a href="'.System::baseUrl().'$1">$1</a>', $text);
-               $text = preg_replace("/\[url\=(\/[$URLSearchString]*)\](.*?)\[\/url\]/ism", '<a href="'.System::baseUrl().'$1">$2</a>', $text);         
 
                $text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/ism", '<a href="$1" target="_blank">$1</a>', $text);
                $text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '<a href="$1" target="_blank">$2</a>', $text);