Spam Filter? Require a certain number of words?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Zugschlus
Regular
Posts: 144
Joined: Sun Feb 05, 2006 12:54 am
Location: St. Ilgen, Germany
Contact:

Spam Filter? Require a certain number of words?

Post 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
--
Marc Haber, St. Ilgen, Germany
https://blog.zugschlus.de/ - nach langer Pause jetzt wieder online
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

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

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Zugschlus
Regular
Posts: 144
Joined: Sun Feb 05, 2006 12:54 am
Location: St. Ilgen, Germany
Contact:

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

Post 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
--
Marc Haber, St. Ilgen, Germany
https://blog.zugschlus.de/ - nach langer Pause jetzt wieder online
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

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

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply