BLIX Theme – Patch For Spam Vulnerability
-
I have been recieving a number of spam messages from my contact form. This form comes with the BLIX theme. The spam messaages all follow a distinct pattern, and include lots of links with the full a href HTML in them.
I created the following code to filter for these messages, and to stop them from being sent. It’s still being tested in a live environment (so far no spam)
It’s not incredibly robust, but should do the trick:
$pos = strpos($bx_message, "<a href");
if ($pos === false) {
// it's not spam.
$send = 1;
} else {
$error_msg.= "<p><strong>Your email will not be sent, as it is suspected to be spam. Remove all HTML tags and try again.</strong></p>n";
$send = 0;
}You should put it after this block in the original code:
if (!is_valid_email($bx_email)) {
$error_msg.= "<p><strong>Your email adress failed to validate.</strong></p>n";
$send = 0;
}I know it could be cleaner, made into a function, etc. etc. I wanted to throw it out to the community instead, as it is a quick fix for an annoying problem.
Hope this helps someone else!
-e
- The topic ‘BLIX Theme – Patch For Spam Vulnerability’ is closed to new replies.