The URL filter calls in method spam_filter_url_update the Bayesian filter method spam_filter_bayesian_tokens_update. This method expects an array, but doesn't check if what it gets actually is an array. If a comment without an URL is marked as spam or as not spam, a PHP warning is triggered (if both the URL and the Bayesian module are active).

Fix 1:
File: spam_filter_url.module Function: spam_filter_url_spam_filter Line: 77
Add $u = array(); before the loop, so that the token method is always called with an array and not null.

Fix 2:
File: spam_filter_bayesian.module Function: spam_filter_bayesian_tokens_update Line: 114
Alternatively, check if $tokens is actually an array before going into the foreach.

Comments

killes@www.drop.org’s picture

Status: Active » Fixed

I believe I fixed that yesterday.

Status: Fixed » Closed (fixed)

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