(hopefully) improve bbcode links in messages

This commit is contained in:
Retro_Guy 2021-08-07 07:48:08 +00:00
parent 000a523529
commit 74f3307f26
1 changed files with 3 additions and 0 deletions

View File

@ -885,6 +885,9 @@ function html_parse($text) {
if(preg_match('/(https?|ftp|news|gopher|telnet)\:\/\/[^\",]+/i', $word)) {
$nlink = trim($word, '().,');
$nlink = preg_replace('/(\&lt|\&gt|\&nbsp);/', '', $nlink);
$nlink = preg_replace('/\[url=/', '', $nlink);
$bbnlink = explode(']', $nlink);
$nlink = $bbnlink[0];
$nword = '<a '.$target.' href="'.$nlink.'">'.$word.'</a>';
if($nword!=$word && substr($nlink, strlen($nlink) - 3) != "://") {
$word=$nword;