function _webform_submission_spam_check in Webform 7.3
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.4 includes/webform.submissions.inc \_webform_submission_spam_check()
1 call to _webform_submission_spam_check()
- webform_submission_send_mail in includes/
webform.submissions.inc - Send related e-mails related to a submission.
File
- includes/
webform.submissions.inc, line 788 - This file is loaded when handling submissions, either submitting new, editing, or viewing. It also contains all CRUD functions for submissions.
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;
}