diff options
Diffstat (limited to 'modules/statistics')
-rw-r--r-- | modules/statistics/statistics.module | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index ec5871ddf..fe9a12b3e 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -62,13 +62,13 @@ function statistics_exit() { if (variable_get('statistics_count_content_views', 0)) { // We are counting content views. - if ((arg(0) == 'node') && arg(1)) { + if ((arg(0) == 'node') && is_numeric(arg(1)) && arg(2) == '') { // A node has been viewed, so update the node's counters. db_query('UPDATE {node_counter} SET daycount = daycount + 1, totalcount = totalcount + 1, timestamp = %d WHERE nid = %d', time(), arg(1)); // If we affected 0 rows, this is the first time viewing the node. if (!db_affected_rows()) { // We must create a new row to store counters for the new node. - db_query('INSERT INTO {node_counter} (nid, daycount, totalcount, timestamp) VALUES(%d, 1, 1, %d)', arg(1), time()); + db_query('INSERT INTO {node_counter} (nid, daycount, totalcount, timestamp) VALUES (%d, 1, 1, %d)', arg(1), time()); } } } |