diff --git a/ext/bbcode/main.php b/ext/bbcode/main.php index b684be12..87eea7c8 100644 --- a/ext/bbcode/main.php +++ b/ext/bbcode/main.php @@ -28,6 +28,7 @@ class BBCode extends FormatterExtension { public function format(/*string*/ $text) { $text = $this->extract_code($text); + $text = preg_replace("/site:\/\//s", make_http(get_base_href())."/", $text); $text = preg_replace("/\[b\](.*?)\[\/b\]/s", "\\1", $text); $text = preg_replace("/\[i\](.*?)\[\/i\]/s", "\\1", $text); $text = preg_replace("/\[u\](.*?)\[\/u\]/s", "\\1", $text); @@ -37,8 +38,8 @@ class BBCode extends FormatterExtension { $text = preg_replace("/>>(\d+)(#c?(\d+))?/s", ">>\\1\\2", $text); $text = preg_replace("/(^|\s)#(\d+)/s", "\\1#\\2", $text); $text = preg_replace("/>>([^\d].+)/", "
\\1
", $text); - $text = preg_replace("/\[url=((?:https?|ftp|irc|mailto):\/\/.*?)\](.*?)\[\/url\]/s", "\\2", $text); - $text = preg_replace("/\[url\]((?:https?|ftp|irc|mailto):\/\/.*?)\[\/url\]/s", "\\1", $text); + $text = preg_replace("/\[url=((?:https?|ftp|irc|mailto|site):\/\/.*?)\](.*?)\[\/url\]/s", "\\2", $text); + $text = preg_replace("/\[url\]((?:https?|ftp|irc|mailto|site):\/\/.*?)\[\/url\]/s", "\\1", $text); $text = preg_replace("/\[email\](.*?)\[\/email\]/s", "\\1", $text); $text = preg_replace("/\[img\](https?:\/\/.*?)\[\/img\]/s", "", $text); $text = preg_replace("/\[\[([^\|\]]+)\|([^\]]+)\]\]/s", "\\2", $text);