function _webform_submission_spam_check in Webform 7.4
Same name and namespace in other branches
- 5.2 webform_submissions.inc \_webform_submission_spam_check()
- 5 webform.inc \_webform_submission_spam_check()
- 6.3 includes/webform.submissions.inc \_webform_submission_spam_check()
- 6.2 webform_submissions.inc \_webform_submission_spam_check()
- 7.3 includes/webform.submissions.inc \_webform_submission_spam_check()
Verify that an email is not attempting to send any spam.
1 call to _webform_submission_spam_check()
- _webform_submission_prepare_mail in includes/
webform.submissions.inc - Prepare a submission email for use by webform_submission_send_mail()
File
- includes/
webform.submissions.inc, line 1009 - Submission handling functions.
Code
function _webform_submission_spam_check($to, $subject, $from, $headers = array()) {
$headers = implode('\\n', (array) $headers);
// Check if they are attempting to spam using a bcc or content type hack.
if (preg_match('/(b?cc\\s?:)|(content\\-type:)/i', $to . "\n" . $subject . "\n" . $from . "\n" . $headers)) {
// Possible spam attempt.
return TRUE;
}
// Not spam.
return FALSE;
}