diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-09-06 08:36:22 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-09-06 08:36:22 +0000 |
commit | e5b0e5f76c0695a01d13c55147a8287df8750594 (patch) | |
tree | d4acfc3f1d038bccaea83e168fdd380d0dfa0708 /modules/statistics/statistics.module | |
parent | cbb639a16ffec82f498ae689818b010e040bf5b4 (diff) | |
download | brdo-e5b0e5f76c0695a01d13c55147a8287df8750594.tar.gz brdo-e5b0e5f76c0695a01d13c55147a8287df8750594.tar.bz2 |
- Patch #302763 by Dave Reid, Rob Loach: replace time() by ['REQUEST_TIME'] as per Rasmus' suggestion. Removed drupal_referrer() for consistency.
Diffstat (limited to 'modules/statistics/statistics.module')
-rw-r--r-- | modules/statistics/statistics.module | 12 |
1 files changed, 6 insertions, 6 deletions
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)); } /** |