diff -du spam/spam.module /home/alexis/m2osw/sources/www/m2osw/drupal/new.m2osw.com/public_html/sites/all/modules/spam/spam.module
--- spam/spam.module	2010-12-24 22:40:01.000000000 -0800
+++ /home/alexis/m2osw/sources/www/m2osw/drupal/new.m2osw.com/public_html/sites/all/modules/spam/spam.module	2010-12-25 17:59:22.215511353 -0800
@@ -46,22 +46,22 @@
   }
   $id = spam_invoke_module($type, 'content_id', $content, $extra);
   spam_log(SPAM_DEBUG, 'spam_scan', t('scanning content'), $type, $id);
-  spam_update_statistics(t('scan @type', array('@type' => $type)));
+  _spam_update_statistics(t('scan @type', array('@type' => $type)));
   if (spam_content_is_spam($content, $type, $extra, $filter_test)) {
     spam_log(SPAM_DEBUG, 'spam_scan', t('content is spam'), $type, $id);
-    spam_update_statistics(t('detected spam @type', array('@type' => $type)));
+    _spam_update_statistics(t('detected spam @type', array('@type' => $type)));
     switch (variable_get('spam_visitor_action', SPAM_ACTION_PREVENT)) {
       case SPAM_ACTION_PREVENT:
         spam_log(SPAM_LOG, 'spam_scan', t('content is spam, action(prevent)'), $type, $id);
       default:
         $_SESSION['content'] = serialize((array)$content);
         $_SESSION['type'] = $type;
-        spam_update_statistics(t('prevented spam @type', array('@type' => $type)));
+        _spam_update_statistics(t('prevented spam @type', array('@type' => $type)));
         drupal_goto('spam/denied');
 
       case SPAM_ACTION_PREVENT_SILENT:
         spam_log(SPAM_LOG, 'spam_scan', t('content is spam, action(prevent silently)'), $type, $id);
-        spam_update_statistics(t('silently prevented spam @type', array('@type' => $type)));
+        _spam_update_statistics(t('silently prevented spam @type', array('@type' => $type)));
         if ($id) {
           // Content was already published, so we unpublish it.
           spam_unpublish($type, $id, $extra);
@@ -73,7 +73,7 @@
 
       case SPAM_ACTION_UNPUBLISH:
         spam_log(SPAM_LOG, 'spam_scan', t('content is spam, action(unpublish)'), $type, $id);
-        spam_update_statistics(t('prevented spam @type', array('@type' => $type)));
+        _spam_update_statistics(t('prevented spam @type', array('@type' => $type)));
         if ($id) {
           spam_unpublish($type, $id, $extra);
         }
@@ -187,10 +187,10 @@
         }
       }
       else {
-        spam_update_statistics(t('prevented spam @type', array('@type' => $type)));
+        _spam_update_statistics(t('prevented spam @type', array('@type' => $type)));
       }
-      spam_update_statistics(t('detected spam'));
-      spam_update_statistics(t('content_filter redirect'));
+      _spam_update_statistics(t('detected spam'));
+      _spam_update_statistics(t('content_filter redirect'));
       spam_log(SPAM_VERBOSE, 'spam_content_filter', t('Spam score [!score], redirecting to: !url', array('!score' => $log_score, '!url' => $redirect)), $type, $id);
       drupal_goto($redirect);
     }
@@ -269,7 +269,7 @@
     spam_mark_as_spam($type, $id, $extra);
     $_SESSION['content'] = serialize((array)$content);
     $_SESSION['type'] = $type;
-    spam_update_statistics(t('prevented spam @type', array('@type' => $type)));
+    _spam_update_statistics(t('prevented spam @type', array('@type' => $type)));
     spam_log(SPAM_DEBUG, 'spam_content_insert', t('redirecting to spam/denied'), $type, $id);
     drupal_goto('spam/denied');
   }
@@ -335,7 +335,7 @@
     spam_mark_as_spam($type, $id, $extra);
     $_SESSION['content'] = serialize((array)$content);
     $_SESSION['type'] = $type;
-    spam_update_statistics(t('prevented spam @type', array('@type' => $type)));
+    _spam_update_statistics(t('prevented spam @type', array('@type' => $type)));
     spam_log(SPAM_DEBUG, 'spam_content_update', t('redirecting to spam/denied'), $type, $id);
     drupal_goto('spam/denied');
   }
@@ -397,17 +397,11 @@
 /**
  * Increment internal counters.
  */
-function spam_update_statistics($name, $op = '+', $inc = 1) {
-  if ($op != '+' && $op != '-') {
-    watchdog('spam', 'Invalid operator(@op), ignored.', array('@op' => $op));
-  }
-  spam_log(LOG_DEBUG, 'spam_update_statistics', t('@name = @name @op @inc', array('@name' => $name, '@op' => $op, '@inc' => $inc)));
-  db_query("UPDATE {spam_statistics} SET count = count %s %d, timestamp = %d WHERE name = '%s'", $op, $inc, time(), $name);
+function _spam_update_statistics($name) {
+  spam_log(LOG_DEBUG, '_spam_update_statistics', t('@name = @name + 1', array('@name' => $name)));
+  db_query("UPDATE {spam_statistics} SET count = count + 1, timestamp = %d WHERE name = '%s'", time(), $name);
   if (!db_affected_rows()) {
-    if ($op == '-') {
-      $inc *= -1;
-    }
-    db_query("INSERT INTO {spam_statistics} (name, count, timestamp) VALUES('%s', %d, %d)", $name, $inc, time());
+    db_query("INSERT INTO {spam_statistics} (name, count, timestamp) VALUES ('%s', 1, %d)", $name, time());
   }
 }
 
@@ -569,10 +563,10 @@
   if (is_numeric($id) && ($action == 'spam' || $action == 'not_spam')) {
     if (spam_invoke_module($type, 'content_module') == $type) {
       if ($action == 'spam') {
-        spam_update_statistics(t('@type manually marked as spam', array('@type' => $type)));
+        _spam_update_statistics(t('@type manually marked as spam', array('@type' => $type)));
       }
       else {
-        spam_update_statistics(t('@type manually marked as not spam', array('@type' => $type)));
+        _spam_update_statistics(t('@type manually marked as not spam', array('@type' => $type)));
       }
       return $type;
     }
@@ -1716,7 +1719,7 @@
   }
   $loop[$id] = TRUE;
 
-  spam_update_statistics(t('@type marked as spam', array('@type' => $type)));
+  _spam_update_statistics(t('@type marked as spam', array('@type' => $type)));
   $extra['sid'] = db_result(db_query("SELECT sid FROM {spam_tracker} WHERE content_type = '%s' AND content_id = %d", $type, $id));
   if (!$extra['score']) {
     $extra['score'] = 99;
@@ -1758,7 +1761,7 @@
   }
   $loop[$id] = TRUE;
 
-  spam_update_statistics(t('@type marked as not spam', array('@type' => $type)));
+  _spam_update_statistics(t('@type marked as not spam', array('@type' => $type)));
   $extra['sid'] = db_result(db_query("SELECT sid FROM {spam_tracker} WHERE content_type = '%s' AND content_id = %d", $type, $id));
   if (!$extra['score']) {
     $extra['score'] = 1;
@@ -2082,7 +2085,7 @@
   spam_log(SPAM_VERBOSE, 'spam_unpublish', t('unpublished'), $type, $id);
   spam_invoke_module($type, 'unpublish', $id, $extra);
   cache_clear_all();
-  spam_update_statistics(t('unpublish @type', array('@type' => $type)));
+  _spam_update_statistics(t('unpublish @type', array('@type' => $type)));
 }
 
 /**
@@ -2093,5 +2096,5 @@
   spam_log(SPAM_VERBOSE, 'spam_publish', t('published'), $type, $id);
   spam_invoke_module($type, 'publish', $id, $extra);
   cache_clear_all();
-  spam_update_statistics(t('publish @type', array('@type' => $type)));
+  _spam_update_statistics(t('publish @type', array('@type' => $type)));
 }
