diff --git a/core/util.inc.php b/core/util.inc.php index 0b533c6b..a44f932a 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -107,6 +107,7 @@ function bbcode_to_html($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("/\[code\](.*?)\[\/code\]/s", "
\\1", $text); $text = preg_replace("/>>(\d+)/s", ">>\\1", $text); $text = preg_replace("/\[\[(.*?)\]\]/s", @@ -121,6 +122,7 @@ function bbcode_to_text($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("/\[code\](.*?)\[\/code\]/s", "\\1", $text); $text = preg_replace("/\[\[(.*?)\]\]/s", "\\1", $text); return $text; } @@ -302,8 +304,9 @@ function get_user() { } if(is_null($user)) { - $user = $database->get_user($config->get_int("anon_id")); + $user = $database->get_user($config->get_int("anon_id", 0)); } + assert(!is_null($user)); return $user; }