From e5b0e5f76c0695a01d13c55147a8287df8750594 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 6 Sep 2008 08:36:22 +0000 Subject: - Patch #302763 by Dave Reid, Rob Loach: replace time() by ['REQUEST_TIME'] as per Rasmus' suggestion. Removed drupal_referrer() for consistency. --- modules/statistics/statistics.module | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/statistics/statistics.module') diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 4242aec5b..32504dfde 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -55,7 +55,7 @@ function statistics_exit() { 'daycount' => 1, 'totalcount' => 1, 'nid' => arg(1), - 'timestamp' => time(), + 'timestamp' => $_SERVER['REQUEST_TIME'], ); db_merge('node_counter') ->fields($fields) @@ -69,12 +69,12 @@ function statistics_exit() { db_insert('accesslog')->fields(array( 'title' => strip_tags(drupal_get_title()), 'path' => $_GET['q'], - 'url' => referer_uri(), + 'url' => $_SERVER['HTTP_REFERER'], 'hostname' => ip_address(), 'uid' => $user->uid, 'sid' => session_id(), 'timer' => timer_read('page'), - 'timestamp' => time(), + 'timestamp' => $_SERVER['REQUEST_TIME'], ))->execute(); } } @@ -188,14 +188,14 @@ function statistics_user($op, &$edit, &$user) { function statistics_cron() { $statistics_timestamp = variable_get('statistics_day_timestamp', ''); - if ((time() - $statistics_timestamp) >= 86400) { + if (($_SERVER['REQUEST_TIME'] - $statistics_timestamp) >= 86400) { // Reset day counts. db_query('UPDATE {node_counter} SET daycount = 0'); - variable_set('statistics_day_timestamp', time()); + variable_set('statistics_day_timestamp', $_SERVER['REQUEST_TIME']); } // Clean up expired access logs. - db_query('DELETE FROM {accesslog} WHERE timestamp < %d', time() - variable_get('statistics_flush_accesslog_timer', 259200)); + db_query('DELETE FROM {accesslog} WHERE timestamp < %d', $_SERVER['REQUEST_TIME'] - variable_get('statistics_flush_accesslog_timer', 259200)); } /** -- cgit v1.2.3