Damn evil spammers
-
Yes, I know this is a topic that has been talked about time and time again, *but* I hate those damn evil spammers. In particular, I can’t understand how they get around my anti-spam techniques.
First: all the spam I get contains either “poker”, “insurance”, or “casino” in the author field.
So, I thought a simple test in wp-comments-post.php to disallow any of those words in the author field would prevent spam. This is – and I know this could be neatened up – was how I knocked it out:
$caught = 0;$bad_words = array (
'poker',
'casino',
'insurance'
);foreach ($bad_words as $value) {
if (strpos($author, $value) != FALSE) {
$caught = 1;
}
}if ($caught == 1) {
echo "I'm sorry, you've used invalid words in your author name, please try again.";
exit;
}(And yes, I know I could halve the number of lines by kicking the post straight out without the second if statement, and the whole $caught nonsense. But I was hacking… give me a break here.)
So I enter it.
And test it. Normal stuff gets through, stuff with “bad words” in the author field does not.
Yet still I get spam from “online poker”. I check my logs – what on earth is happening?
Can anyone tell me what I am doing wrong?
Thanks,
Robert
- The topic ‘Damn evil spammers’ is closed to new replies.