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

CommentFileSizeAuthor
#1 spam-6.x-duplicate_count.patch1.46 KBAlexisWilke

Comments

AlexisWilke’s picture

Title: Duplicate filter uses wrong Database result » Duplicate filter uses wrong Database result (CRITICAL, ALL MUST APPLY FIX!)
Status: Active » Needs review
StatusFileSize
new1.46 KB

Committed 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

killes@www.drop.org’s picture

Status: Needs review » Fixed

marking fixed

AlexisWilke’s picture

Thank you Killes. 8-)

I have a strange concept of "a few weeks" I know...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.