diff --git a/ext/bbcode/main.php b/ext/bbcode/main.php index 843e03f0..87eea7c8 100644 --- a/ext/bbcode/main.php +++ b/ext/bbcode/main.php @@ -15,6 +15,8 @@ *
  • [i]italic[/i] *
  • [u]underline[/u] *
  • [s]strikethrough[/s] + *
  • [sup]superscript[/sup] + *
  • [sub]subscript[/sub] *
  • [[wiki article]] *
  • [[wiki article|with some text]] *
  • [quote]text[/quote] @@ -25,20 +27,19 @@ class BBCode extends FormatterExtension { public function format(/*string*/ $text) { - $text = preg_replace_callback("/(\[img\]https?:\/\/.*?\[\/img\])/s", array($this, "unwrap"), $text); - $text = preg_replace_callback("/(\[url=(?:https?|ftp|irc|mailto):\/\/.*?\])/s", array($this, "unwrap"), $text); - $text = preg_replace_callback("/(\[url\](?:https?|ftp|irc|mailto):\/\/.*?\[\/url\])/s", array($this, "unwrap"), $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); $text = preg_replace("/\[s\](.*?)\[\/s\]/s", "\\1", $text); + $text = preg_replace("/\[sup\](.*?)\[\/sup\]/s", "\\1", $text); + $text = preg_replace("/\[sub\](.*?)\[\/sub\]/s", "\\1", $text); $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); @@ -66,10 +67,6 @@ class BBCode extends FormatterExtension { return $text; } - private function unwrap($matches) { - return str_replace(' ', '', $matches[1]); - } - public function strip(/*string*/ $text) { $text = preg_replace("/\[b\](.*?)\[\/b\]/s", "\\1", $text); $text = preg_replace("/\[i\](.*?)\[\/i\]/s", "\\1", $text); diff --git a/ext/comment/theme.php b/ext/comment/theme.php index 0b644390..51d7092a 100644 --- a/ext/comment/theme.php +++ b/ext/comment/theme.php @@ -203,7 +203,7 @@ class CommentListTheme extends Themelet { $hash = md5(strtolower($comment->owner_email)); $h_avatar = "
    "; } - $h_reply = " - Reply"; + $h_reply = " - Reply"; $h_ip = $user->can("view_ip") ? "
    ".show_ip($comment->poster_ip, "Comment posted {$comment->posted}") : ""; $h_del = $user->can("delete_comment") ? ' -