diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-03-03 15:30:15 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-03-03 15:30:15 +0000 |
commit | 16e6b6f137b728f7b3dda2457e0682acb5ff2e4a (patch) | |
tree | d009ddf027c02b889b56eb4ee4309c8714784ddf | |
parent | 87cfda720e8ec8ac86337a2b1cc25ab7af663be7 (diff) | |
download | brdo-16e6b6f137b728f7b3dda2457e0682acb5ff2e4a.tar.gz brdo-16e6b6f137b728f7b3dda2457e0682acb5ff2e4a.tar.bz2 |
code revision:
- fixed a "visual-quote-glitch", i.e. a missing stripslashes()
-rw-r--r-- | includes/watchdog.inc | 3 | ||||
-rw-r--r-- | modules/watchdog.module | 8 | ||||
-rw-r--r-- | modules/watchdog/watchdog.module | 8 |
3 files changed, 10 insertions, 9 deletions
diff --git a/includes/watchdog.inc b/includes/watchdog.inc index da24d79d8..628fabcca 100644 --- a/includes/watchdog.inc +++ b/includes/watchdog.inc @@ -10,6 +10,7 @@ $watchdog = array("comment" => array("0", $submission_rate["comment"]), function watchdog($id, $message) { global $user, $watchdog, $watchdog_history; + // flood protection: if ($watchdog[$id][1] && !user_access($user, "watchdog")) { if ($log = db_fetch_object(db_query("SELECT * FROM watchdog WHERE hostname = '". getenv("REMOTE_ADDR") ."' AND level = '". $watchdog[$id][0] ."'"))) { if (time() - $log->timestamp < $watchdog[$id][1]) { @@ -20,7 +21,7 @@ function watchdog($id, $message) { } } - // Perform query to add new watchdog entry: + // perform query to add new watchdog entry: db_query("INSERT INTO watchdog (level, timestamp, user, message, location, hostname) VALUES ('". $watchdog[$id][0] ."', '". time() ."', '". check_input($user->id) ."', '". check_input($message) ."', '". check_input(getenv("REQUEST_URI")) ."', '". check_input(getenv("REMOTE_ADDR")) ."')"); } diff --git a/modules/watchdog.module b/modules/watchdog.module index 9980a9c36..f30ac4864 100644 --- a/modules/watchdog.module +++ b/modules/watchdog.module @@ -57,12 +57,12 @@ function watchdog_view($id) { if ($watchdog = db_fetch_object($result)) { $output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n"; - $output .= " <TR><TH>Level:</TH><TD>$watchdog->level</TD></TR>\n"; + $output .= " <TR><TH>Level:</TH><TD>". check_output($watchdog->level) ."</TD></TR>\n"; $output .= " <TR><TH>Date:</TH><TD>". format_date($watchdog->timestamp, "large") ."</TD></TR>\n"; $output .= " <TR><TH>User:</TH><TD>". format_username($watchdog->userid) ."</TD></TR>\n"; - $output .= " <TR><TH>Location:</TH><TD>$watchdog->location</TD></TR>\n"; - $output .= " <TR><TH>Message:</TH><TD>$watchdog->message</TD></TR>\n"; - $output .= " <TR><TH>Hostname:</TH><TD>$watchdog->hostname</TD></TR>\n"; + $output .= " <TR><TH>Location:</TH><TD>". check_output($watchdog->location). "</TD></TR>\n"; + $output .= " <TR><TH>Message:</TH><TD>". check_output($watchdog->message) ."</TD></TR>\n"; + $output .= " <TR><TH>Hostname:</TH><TD>". check_output($watchdog->hostname) ."</TD></TR>\n"; $output .= "</TABLE>\n"; print $output; } diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module index 9980a9c36..f30ac4864 100644 --- a/modules/watchdog/watchdog.module +++ b/modules/watchdog/watchdog.module @@ -57,12 +57,12 @@ function watchdog_view($id) { if ($watchdog = db_fetch_object($result)) { $output .= "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\">\n"; - $output .= " <TR><TH>Level:</TH><TD>$watchdog->level</TD></TR>\n"; + $output .= " <TR><TH>Level:</TH><TD>". check_output($watchdog->level) ."</TD></TR>\n"; $output .= " <TR><TH>Date:</TH><TD>". format_date($watchdog->timestamp, "large") ."</TD></TR>\n"; $output .= " <TR><TH>User:</TH><TD>". format_username($watchdog->userid) ."</TD></TR>\n"; - $output .= " <TR><TH>Location:</TH><TD>$watchdog->location</TD></TR>\n"; - $output .= " <TR><TH>Message:</TH><TD>$watchdog->message</TD></TR>\n"; - $output .= " <TR><TH>Hostname:</TH><TD>$watchdog->hostname</TD></TR>\n"; + $output .= " <TR><TH>Location:</TH><TD>". check_output($watchdog->location). "</TD></TR>\n"; + $output .= " <TR><TH>Message:</TH><TD>". check_output($watchdog->message) ."</TD></TR>\n"; + $output .= " <TR><TH>Hostname:</TH><TD>". check_output($watchdog->hostname) ."</TD></TR>\n"; $output .= "</TABLE>\n"; print $output; } |