hijack

Check for header injection attack and spam in your php form script

I wrote this to check for header injection attempts when processing a form that sends an email with php. (and I'll put it here so I can find it)

function is_spam( $message, $threshold = 1 ){
return _count_spam_body($message, $threshold) >= $threshold;
}

function _count_spam_body( $message, $threshold = 1 ){

$message = trim(strtolower($message));

//check the body of the message for spam or header injection attempts
$matches_bad = array(
"bcc:",
"cc:",
"to:",
"content-type:",
"mime-version:",
"multipart/mixed",





Syndicate content