You are here

function spam_error_page_submit in Spam 5.3

Same name and namespace in other branches
  1. 6 spam.module \spam_error_page_submit()

Store reported legitimate content in database.

File

./spam.module, line 1616

Code

function spam_error_page_submit($form_id, $form_values) {
  global $user;
  $content = unserialize($_SESSION['content']);
  $id = spam_invoke_module($type, 'content_id', $content);
  $hash = md5($_SESSION['content']);
  $type = $_SESSION['type'];
  if (is_array($_SESSION['spam_form'])) {
    $spam_form = serialize($_SESSION['spam_form']);
  }
  else {
    $spam_form = $_SESSION['spam_form'];
  }
  db_query("INSERT INTO {spam_filters_errors} (uid, content_type, content_id, content_hash, content, form, hostname, feedback, timestamp) VALUES(%d, '%s', %d, '%s', '%s', '%s', '%s', '%s', %d)", $user->uid, $type, $id, $hash, $_SESSION['content'], $spam_form, $_SERVER['REMOTE_ADDR'], $form_values['feedback'], time());
  $_SESSION['content'] = $_SESSION['type'] = $_SESSION['spam_form'] = '';
  drupal_set_message(t('Your feedback will be reviewed by a site administrator.'));
  drupal_goto('');
}