From f372173431d9bb4e1a82a409a1745a665608729a Mon Sep 17 00:00:00 2001 From: shish Date: Thu, 17 May 2007 03:49:23 +0000 Subject: [PATCH] support code tag, and checks in get_user git-svn-id: file:///home/shish/svn/shimmie2/trunk@109 7f39781d-f577-437e-ae19-be835c7a54ca --- core/util.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; }