mirror of
https://github.com/friendica/friendica
synced 2024-11-10 05:42:54 +00:00
BBCode - removed convert for relative URLs
This commit is contained in:
parent
a505dbbe5c
commit
6ba08e510d
1 changed files with 1 additions and 4 deletions
|
@ -1362,13 +1362,10 @@ class BBCode extends BaseObject
|
||||||
}, $text);
|
}, $text);
|
||||||
|
|
||||||
// We need no target="_blank" for local links
|
// 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());
|
$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">$1$2</a>', $text);
|
||||||
$text = preg_replace("/\[url\=($escapedBaseUrl)([$URLSearchString]*)\](.*?)\[\/url\]/ism", '<a href="$1$2">$3</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">$1</a>', $text);
|
||||||
$text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '<a href="$1" target="_blank">$2</a>', $text);
|
$text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '<a href="$1" target="_blank">$2</a>', $text);
|
||||||
|
|
Loading…
Reference in a new issue