Page 1 of 1

Spam Filter? Require a certain number of words?

Posted: Thu Apr 03, 2008 4:20 pm
by Zugschlus
Hi,

a persistent spammer on my blog posts ads that have a very short command/trackback body. Would it be possible to extend s9y to require a (configurable) number of words in the comment/trackback to have it accepted?

I'd like to be able to automatically reject comments/trackbacks shorter than five words.

Greetings
Marc

Re: Spam Filter? Require a certain number of words?

Posted: Thu Apr 03, 2008 6:45 pm
by garvinhicking
Hi!

How about trying to reject this via mod_rewrite or custom PHP code in your serendipity_config_local.inc.php? That saves you a lot of processing power.

Something along the lines of

Code: Select all

if (strlen($_REQUEST['excerpt']) < 5) {
  die('Die already, s.o.b.');
}
Regards,
Garvin

Re: Spam Filter? Require a certain number of words?

Posted: Thu Apr 03, 2008 10:41 pm
by Zugschlus
garvinhicking wrote: How about trying to reject this via mod_rewrite or custom PHP code in your serendipity_config_local.inc.php? That saves you a lot of processing power.

Something along the lines of

Code: Select all

if (strlen($_REQUEST['excerpt']) < 5) {
  die('Die already, s.o.b.');
}
Wouldn't that catuch things shorter than five characters instead of five words? I suspect that this spammer is not only pestering me, so having this configurable via the frontend would probably be desireable.

Greetings
Marc

Re: Spam Filter? Require a certain number of words?

Posted: Fri Apr 04, 2008 1:06 pm
by garvinhicking
Hi!

Yeah, of course you can use substr_count() or regexps or whatever else, this was just an example :)

Spammers will always adapt; such a thing is so easily circumventable that adding it as a config option would simply be too much.

Best regards,
Garvin