You are here

function _webform_submission_spam_check in Webform 6.3

Same name and namespace in other branches
  1. 5.2 webform_submissions.inc \_webform_submission_spam_check()
  2. 5 webform.inc \_webform_submission_spam_check()
  3. 6.2 webform_submissions.inc \_webform_submission_spam_check()
  4. 7.4 includes/webform.submissions.inc \_webform_submission_spam_check()
  5. 7.3 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 753
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)) {
    return TRUE;

    // Possible spam attempt.
  }
  return FALSE;

  // Not spam.
}