You are here

function contact_spam_scan in Spam 6

Scan contact form content before it is sent to users.

1 string reference to 'contact_spam_scan'
contact_spamapi_form_alter in content/spam_content_contact.inc
Form alter gets its own function so we can reference &$form without causing errors in PHP4 installations. (If we use spamapi, we have to set a default, which PHP4 doesn't support.)

File

content/spam_content_contact.inc, line 211
Include file for integration with the contact form.

Code

function contact_spam_scan($form, &$form_state) {
  $contact = $form['#post'];
  $contact['type'] = $form['form_id']['#value'];
  $_SESSION['spam_form'] = $form_state;
  spam_scan($contact, 'contact');

  // spam_form is used if we catch spam in spam_scan, we can now free it
  if (isset($_SESSION['spam_form'])) {
    unset($_SESSION['spam_form']);
  }
}