You are here

function get_fields_any in Anti Spam by CleanTalk 7

Same name and namespace in other branches
  1. 8 cleantalk.module \get_fields_any()
  2. 7.2 cleantalk.module \get_fields_any()
1 call to get_fields_any()
cleantalk_boot in ./cleantalk.module
Implements hook_boot()

File

./cleantalk.module, line 2234
Main CleanTalk integration module functions.

Code

function get_fields_any(&$email, &$message, &$nickname, &$subject, &$contact, $arr) {
  $skip_params = array(
    'ipn_track_id',
    // PayPal IPN #
    'txn_type',
    // PayPal transaction type
    'payment_status',
  );
  foreach ($arr as $key => $value) {
    if (!is_array($value) && !is_object($value)) {
      if (in_array($key, $skip_params) && $key != 0 && $key != '' || preg_match("/^ct_checkjs/", $key)) {
        $contact = false;
      }
      if ($email === '' && preg_match("/^\\S+@\\S+\\.\\S+\$/", $value)) {
        $email = $value;
      }
      else {
        if ($nickname === '' && get_data_from_submit($value, 'name')) {
          $nickname = $value;
        }
        else {
          if ($subject === '' && get_data_from_submit($value, 'subject')) {
            $subject = $value;
          }
          else {
            $message .= "{$value}\n";
          }
        }
      }
    }
    else {
      get_fields_any($email, $message, $nickname, $subject, $contact, $value);
    }
  }
}