# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: contributions/modules/spam/filters/spam_filter_duplicate/spam_filter_duplicate.module
--- contributions/modules/spam/filters/spam_filter_duplicate/spam_filter_duplicate.module Base (1.1.2.1)
+++ contributions/modules/spam/filters/spam_filter_duplicate/spam_filter_duplicate.module Locally Modified (Based On 1.1.2.1)
@@ -376,7 +376,7 @@
   // This unfortunately has to be SQL because the pager module can't be told
   // how many rows we've got (so we can't do our own processing in PHP and
   // still get paging to work properly).
-  $sql = "SELECT * FROM (SELECT DISTINCT x.hostname, x.timestamp, COUNT(x.hostname) AS count FROM (SELECT timestamp, hostname FROM {spam_tracker} WHERE score > %d ORDER BY timestamp DESC) AS x GROUP BY x.hostname) AS y WHERE y.count >= %d";
+  $sql = "SELECT * FROM (SELECT hostname, MAX(timestamp), COUNT(hostname) AS count FROM {spam_tracker} WHERE score > %d GROUP BY hostname) AS y WHERE y.count >= %d";
   $arguments = array(variable_get('spam_threshold', SPAM_DEFAULT_THRESHOLD), variable_get('spam_blacklist_ip', SPAM_FILTER_DUPLICATE_DEFAULT_BLACKLIST));
 
   $count_sql = preg_replace('/^SELECT \* /', 'SELECT count(hostname) ', $sql);
Index: contributions/modules/spam/spam.module
--- contributions/modules/spam/spam.module Base (1.51.4.1.2.41.2.30.2.18)
+++ contributions/modules/spam/spam.module Locally Modified (Based On 1.51.4.1.2.41.2.30.2.18)
@@ -294,7 +294,7 @@
   $score = 0;
   if ($id) {
     $score = spam_content_filter($content, $type, $extra);
-    db_query("UPDATE {spam_tracker} SET score = %d, hostname = %d, timestamp = %d WHERE content_type = '%s' AND content_id = '%s'", $score, time(), $type, $id);
+    db_query("UPDATE {spam_tracker} SET score = %d, hostname = %d, timestamp = %d WHERE content_type = '%s' AND content_id = %d", $score, time(), $type, $id);
     $sid = db_result(db_query("SELECT sid FROM {spam_tracker} WHERE content_type = '%s' AND content_id = %d", $type, $id));
     if ($sid) {
       watchdog('spam', 'Updated %type with id %id in spam tracker table.', array('%type' => $type, '%id' => $id), WATCHDOG_NOTICE);
