diff --git a/core/util.inc.php b/core/util.inc.php index 4b747190..aa272703 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -110,6 +110,8 @@ function bbcode_to_html($text) { $text = preg_replace("/\[code\](.*?)\[\/code\]/s", "
\\1
", $text); $text = preg_replace("/>>(\d+)/s", ">>\\1", $text); + $text = preg_replace("/\[url=((?:https?|ftp|irc):\/\/.*?)\](.*?)\[\/url\]/s", "\\2", $text); + $text = preg_replace("/\[url\]((?:https?|ftp|irc):\/\/.*?)\[\/url\]/s", "\\1", $text); $text = preg_replace("/\[\[(.*?)\]\]/s", "\\1", $text); $text = str_replace("\n", "\n
", $text); @@ -123,6 +125,8 @@ function bbcode_to_text($text) { $text = preg_replace("/\[i\](.*?)\[\/i\]/s", "\\1", $text); $text = preg_replace("/\[u\](.*?)\[\/u\]/s", "\\1", $text); $text = preg_replace("/\[code\](.*?)\[\/code\]/s", "\\1", $text); + $text = preg_replace("/\[url=(.*?)\](.*?)\[\/url\]/s", "\\2", $text); + $text = preg_replace("/\[url\](.*?)\[\/url\]/s", "\\1", $text); $text = preg_replace("/\[\[(.*?)\]\]/s", "\\1", $text); return $text; }