summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjartan Mannes <kjartan@2.no-reply.drupal.org>2003-12-18 13:58:59 +0000
committerKjartan Mannes <kjartan@2.no-reply.drupal.org>2003-12-18 13:58:59 +0000
commit3d9e2f2c76077f59d76a0e400751f2b28ffb5556 (patch)
treeac092b164a7bd955fa29b1ec646f630545a3c61a
parent09b660a6085b972196ba68ce0f9dd8bce9516ca9 (diff)
downloadbrdo-3d9e2f2c76077f59d76a0e400751f2b28ffb5556.tar.gz
brdo-3d9e2f2c76077f59d76a0e400751f2b28ffb5556.tar.bz2
- Fixing wrong superglobal usage.
-rw-r--r--includes/bootstrap.inc2
-rw-r--r--includes/common.inc4
2 files changed, 3 insertions, 3 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 53932807d..8f0fa9ec6 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -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);
diff --git a/includes/common.inc b/includes/common.inc
index 497e82f79..9761314aa 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -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());
}
}