From b1ef96931af52cd6234162f4d2dc6e2736c00d8e Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 10 Dec 2003 23:09:31 +0000 Subject: - Moved the watchdog() function to the bootsrap file. Patch by Moshe. --- includes/bootstrap.inc | 5 +++++ includes/common.inc | 12 +++++------- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'includes') diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index c13f1b8b7..eb15f13d8 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -213,6 +213,11 @@ function timer_start() { $timer = (float)$usec + (float)$sec; } +function watchdog($type, $message, $link = NULL) { + global $user; + db_query("INSERT INTO {watchdog} (uid, type, message, link, location, hostname, timestamp) VALUES (%d, '%s', '%s', '%s', '%s', '%s', %d)", $user->uid, $type, $message, $link, request_uri(), getenv("REMOTE_ADDR"), time()); +} + unset($conf); $config = conf_init(); diff --git a/includes/common.inc b/includes/common.inc index c46f10586..351e0e07e 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -118,11 +118,6 @@ function error_handler($errno, $message, $filename, $line, $variables) { } } -function watchdog($type, $message, $link = NULL) { - global $user; - db_query("INSERT INTO {watchdog} (uid, type, message, link, location, hostname, timestamp) VALUES (%d, '%s', '%s', '%s', '%s', '%s', %d)", $user->uid, $type, $message, $link, request_uri(), getenv("REMOTE_ADDR"), time()); -} - function throttle($type, $rate) { if (!user_access("access administration pages")) { if ($throttle = db_fetch_object(db_query("SELECT * FROM {watchdog} WHERE type = '$type' AND hostname = '". getenv("REMOTE_ADDR") ."' AND ". time() ." - timestamp < $rate"))) { @@ -555,8 +550,11 @@ function check_output($text) { // filter content on output: $text = filter($text); - // get the line breaks right: - if (strip_tags($text, "") == $text) { + /* + ** If only inline elements are used and no block level elements, we + ** replace all newlines with HTML line breaks. + */ + if (strip_tags($text, '