The following statement expects the COUNT() in the $spam_filter_duplicate_ip when in fact the resource of the db_query() call is returned.
$spam_filter_duplicate_ip = (int)db_query("SELECT COUNT(iid) FROM {spam_filter_duplicate} WHERE hostname = '%s' AND spam = %d", ip_address(), SPAM_FILTER_DUPLICATE_SPAM);
Adding a db_result() fixes the problem.
This fixes all the problems with the duplicate module that were reported in other issues (but I could not find the specific issue for this one...) More or less, people who reported being kicked out of their website and yet not having posted spam.
Thank you.
Alexis Wilke
Comments
Comment #1
AlexisWilke commentedCommitted immediately because this is deadly critical for anyone using the Duplicate module.
Feel free to review at your leisure. I will mark this as fixed with a few weeks.
http://drupal.org/cvs?commit=499096
Comment #2
killes@www.drop.org commentedmarking fixed
Comment #3
AlexisWilke commentedThank you Killes. 8-)
I have a strange concept of "a few weeks" I know...