- Fixing wrong superglobal usage.

4.4.x
Kjartan Mannes 2003-12-18 13:58:59 +00:00
parent 09b660a608
commit 3d9e2f2c76
2 changed files with 3 additions and 3 deletions

View File

@ -218,7 +218,7 @@ function timer_start() {
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(), $_ENV['REMOTE_ADDR'], time());
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(), $_SERVER['REMOTE_ADDR'], time());
}
unset($conf);

View File

@ -135,8 +135,8 @@ function error_handler($errno, $message, $filename, $line, $variables) {
function throttle($type, $rate) {
if (!user_access("access administration pages")) {
if ($throttle = db_fetch_object(db_query("SELECT * FROM {watchdog} WHERE type = '%s' AND hostname = '%s' AND %d - timestamp < %d", $type, $_ENV['REMOTE_ADDR'], time(), $rate))) {
watchdog("warning", "throttle: '". $_ENV['REMOTE_ADDR'] ."' exceeded submission rate - $throttle->type");
if ($throttle = db_fetch_object(db_query("SELECT * FROM {watchdog} WHERE type = '%s' AND hostname = '%s' AND %d - timestamp < %d", $type, $_SERVER['REMOTE_ADDR'], time(), $rate))) {
watchdog("warning", "throttle: '". $_SERVER['REMOTE_ADDR'] ."' exceeded submission rate - $throttle->type");
die(message_throttle());
}
}