(hopefully) improve bbcode links in messages
This commit is contained in:
parent
000a523529
commit
74f3307f26
|
@ -885,6 +885,9 @@ function html_parse($text) {
|
|||
if(preg_match('/(https?|ftp|news|gopher|telnet)\:\/\/[^\",]+/i', $word)) {
|
||||
$nlink = trim($word, '().,');
|
||||
$nlink = preg_replace('/(\<|\>|\ );/', '', $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;
|
||||
|
|
Loading…
Reference in New Issue