Merge pull request #6516 from Ixiter/develop
BBCode - added preg_replaces for local [url] links without target="_blank"
This commit is contained in:
commit
2d49b71a4c
1 changed files with 6 additions and 0 deletions
|
@ -1361,6 +1361,12 @@ class BBCode extends BaseObject
|
|||
. '</a>';
|
||||
}, $text);
|
||||
|
||||
// We need no target="_blank" for local links
|
||||
// convert links start with System::baseUrl() as local link without the target="_blank" attribute
|
||||
$escapedBaseUrl = preg_quote(System::baseUrl(), '/');
|
||||
$text = preg_replace("/\[url\](".$escapedBaseUrl."[$URLSearchString]*)\[\/url\]/ism", '<a href="$1">$1</a>', $text);
|
||||
$text = preg_replace("/\[url\=(".$escapedBaseUrl."[$URLSearchString]*)\](.*?)\[\/url\]/ism", '<a href="$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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue