From 6c99c2d86f305b61bd3dce90416d733c63a774f4 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 10 Feb 2004 19:41:57 +0000 Subject: - Patch #5766 by Moshe: replace getenv() with $_SERVER. --- modules/statistics.module | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/statistics.module') 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()); -- cgit v1.2.3