Hi,

I installed the module and several filters. The only filter which shows up messages in Spam logs is the Bayesian filter. It finds nearly everything interesting which always leads to a final average(40) result for each post.

But I also activated Duplicate filter and URL filter - but although I posted the same text several times the Duplicate filter shows always Duplicate filter: total() redirect() gain(200) (maximum duplicates is set to 2 - I wrote the text many times more in content types which should be checked!). For URL filter I set "Maximum total URLs per post" to 1 for testing and put 2 links into the text of my content but the URL filter always shows the message URL-Filter: total(0) redirect() gain(100).

Do I miss something?

Best,
Tobias

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AlexisWilke’s picture

Would you mind testing with the development version and report whether it works better or not.

Thank you.
Alexis Wilke

P.S. I actually posted 1.4 which would have been the development version before...

tobiberlin’s picture

Version: 6.x-1.3 » 6.x-1.4

Ok... I updated to version 6.x-1.4 and have the same issue.

With dev-version I find another behavior: if I insert duplicate content it is treated by spam filter as I want it (not published, message to user) but not the duplicate content filter seems to work but the Bayesian.

       Bayesian filter: total(99) redirect() gain(100)
	Duplicate filter: total(0) redirect() gain(200)

Additionally the user does not see the message defined in the dublicate content filter setting but the general message defined in general settings. The URL filter does not work as well: I tried again to put two links into a node where just one link is allowed by URL filter.

URL-Filter: total(0) redirect() gain(100)

But Surbl filter checks the two links and sees them as not spam url (correctly).

Best,
Tobias

Anonymous’s picture

I can confirm this behaviour. URL filter is not working at all.

hermann77’s picture

Component: Miscellaneous » URL Filter
Assigned: Unassigned » hermann77
Issue tags: +spam_filter_url bug
FileSize
5.73 KB

1-st problem: regular expressions in spam_filter_url.module function _spam_filter_url_extract() didn't work.
I have adapted the reg. exp.

2-nd problem I had: module evaluates double count of URL's. For example, if the description text includes 5 URL's the module thinks it's already 10 URL's.
I found that all hooks are called 2 times (maybe it's only in my case) AND $spam_filter_urls is static. As a result the variable $count (function spam_filter_url_spam_filter()) has double count.
For prevent doubling the URL's count I applied condition "if (is_object($content)) {" in function _spam_filter_url_extract() for all the function body. is_object($content) is TRUE only ONE time while UPDATE/INSERT a node

AlexisWilke’s picture

What the heck is that?!

db_query("INSERT INTO {test} (test) VALUES('3')");

From what I can see you included quite a few things that were not changed at all (just the formatting) and you did not respect the tabs/spaces in the patch. I'm not familiar with that code, but it looks like your version is a lot simpler... so it's probably a good patch! 8-)

Thank you.
Alexis Wilke

hermann77’s picture

Assigned: hermann77 » Unassigned
FileSize
5.68 KB

Hi Alexis,

sorry for db_query("INSERT INTO {test} (test) VALUES('3')");
It's just debugging info I forgotten.

No, I have changed not only formatting (sorry for 8 char-tabs, it's just more readable for me but it's 2 now). Check the function _spam_filter_url_extract() please.
1. The control flow is different: check lines 60-62. The code from line 60 will by executed just one time and not 2 times like before.
2. RegExp was changed.

kle’s picture

Hello herrmann77!
the patch #6 does not work properly.
your change in function _spam_filter_url_extract of putting away closing-bracket:

  if (is_object($content)) {
    $content = (array)$content;

has the effect, that the body of the function never runs.

I'd put it in the old structure: add the } and delte these end-lines at end:

}
  else {
     return $spam_filter_urls;
  }

then its called doubled but ok. now I diveded the result by 2 - its a hack, but the whole code has to be rewritten.
In function spam_filter_url_spam_filter() change to this:

if ($limit > -1 && ($count['total'] /2)> $limit) { // the division by 2 is because _spam_filter_url_count() is alwyas called twice *bad!!*
[...]
if (($max/2) > $limit ) { // the division by 2 is because _spam_filter_url_count() is alwyas called twice *bad!!* 

Sorry - I'm not able to patch the patch. Its only a suggestion...

CMangrum’s picture

I know this is a bit old, but the URL filter is not working for me either. It doesn't matter if I set it to a maximum of 1, spam still gets through. I have tried to follow the comments on the patch and modifications of the patch to get it to work right, but I'm a bit confused. Does someone have a complete patch or instructions on modifying the module code that will make it work right?

apaderno’s picture

Version: 6.x-1.4 » 6.x-1.x-dev
Issue summary: View changes
Status: Active » Closed (outdated)
Issue tags: -spam_filter_url bug

I am closing this issue, since Drupal 6 isn't supported anymore.