diff options
-rw-r--r-- | modules/comment.module | 2 | ||||
-rw-r--r-- | modules/comment/comment.module | 2 | ||||
-rw-r--r-- | modules/statistics.module | 3 | ||||
-rw-r--r-- | modules/statistics/statistics.module | 3 |
4 files changed, 6 insertions, 4 deletions
diff --git a/modules/comment.module b/modules/comment.module index 9dfee0ef1..702c6c368 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -435,7 +435,7 @@ function comment_post($edit) { $edit["cid"] = db_next_id("{comments}_cid"); - db_query("INSERT INTO {comments} (cid, nid, pid, uid, subject, comment, hostname, timestamp, status, score, users, thread) VALUES (%d, %d, %d, %d, '%s', '%s', '%s', %d, %d, %d, '%s', '%s')", $edit["cid"], $edit["nid"], $edit["pid"], $user->uid, $edit["subject"], $edit["comment"], getenv("REMOTE_ADDR"), time(), $status, $score, $users, $thread); + db_query("INSERT INTO {comments} (cid, nid, pid, uid, subject, comment, hostname, timestamp, status, score, users, thread) VALUES (%d, %d, %d, %d, '%s', '%s', '%s', %d, %d, %d, '%s', '%s')", $edit["cid"], $edit["nid"], $edit["pid"], $user->uid, $edit["subject"], $edit["comment"], $_SERVER['REMOTE_ADDR'], time(), $status, $score, $users, $thread); /* ** Tell the other modules a new comment has been submitted: diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 9dfee0ef1..702c6c368 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -435,7 +435,7 @@ function comment_post($edit) { $edit["cid"] = db_next_id("{comments}_cid"); - db_query("INSERT INTO {comments} (cid, nid, pid, uid, subject, comment, hostname, timestamp, status, score, users, thread) VALUES (%d, %d, %d, %d, '%s', '%s', '%s', %d, %d, %d, '%s', '%s')", $edit["cid"], $edit["nid"], $edit["pid"], $user->uid, $edit["subject"], $edit["comment"], getenv("REMOTE_ADDR"), time(), $status, $score, $users, $thread); + db_query("INSERT INTO {comments} (cid, nid, pid, uid, subject, comment, hostname, timestamp, status, score, users, thread) VALUES (%d, %d, %d, %d, '%s', '%s', '%s', %d, %d, %d, '%s', '%s')", $edit["cid"], $edit["nid"], $edit["pid"], $user->uid, $edit["subject"], $edit["comment"], $_SERVER['REMOTE_ADDR'], time(), $status, $score, $users, $thread); /* ** Tell the other modules a new comment has been submitted: diff --git a/modules/statistics.module b/modules/statistics.module index f25f87542..70a9cfa01 100644 --- a/modules/statistics.module +++ b/modules/statistics.module @@ -21,7 +21,8 @@ function statistics_exit() { if ((variable_get("statistics_enable_access_log", 0)) && (module_invoke("throttle", "status") < 5)) { // statistical logs are enabled $referrer = referer_uri(); - $hostname = getenv("REMOTE_ADDR"); + $hostname = $_SERVER['REMOTE_ADDR']; + // log this page access if ((arg(0) == "node") && (arg(1) == "view") && arg(2)) { db_query("INSERT INTO {accesslog} (nid, url, hostname, uid, timestamp) values(%d, '%s', '%s', %d, %d)", arg(2), $referrer, $hostname, $user->uid, time()); diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index f25f87542..70a9cfa01 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -21,7 +21,8 @@ function statistics_exit() { if ((variable_get("statistics_enable_access_log", 0)) && (module_invoke("throttle", "status") < 5)) { // statistical logs are enabled $referrer = referer_uri(); - $hostname = getenv("REMOTE_ADDR"); + $hostname = $_SERVER['REMOTE_ADDR']; + // log this page access if ((arg(0) == "node") && (arg(1) == "view") && arg(2)) { db_query("INSERT INTO {accesslog} (nid, url, hostname, uid, timestamp) values(%d, '%s', '%s', %d, %d)", arg(2), $referrer, $hostname, $user->uid, time()); |