You are here

function _webform_submission_spam_check in Webform 5

Same name and namespace in other branches
  1. 5.2 webform_submissions.inc \_webform_submission_spam_check()
  2. 6.3 includes/webform.submissions.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_client_form_submit in ./webform.module

File

./webform.inc, line 252

Code

function _webform_submission_spam_check($to, $subject, $message, $from, $headers = array()) {
  $headers = implode('\\n', $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.
}