/**
  * Check input
  * @param mixed $data Input string or array to be checked
  * @param array $config Configuration
  * @static
  * @public
  */
 public static function check($data, $config = array())
 {
     $c = new mail_input_validation($config);
     if (is_array($data)) {
         foreach ($data as $key => $val) {
             if (is_array($val)) {
                 foreach ($val as $skey => $sval) {
                     $val[$skey] = $c->process($sval);
                 }
             } elseif (is_string($val)) {
                 $val = $c->process($val);
             }
             $data[$key] = $val;
         }
         // Add result message
         $data['mail_input_validation_result'] = join(" \r\n", $c->result);
     } elseif (is_string($data)) {
         $data = $c->process($data);
     }
     return $data;
 }
Beispiel #2
0
                 }
                 $attachment_file_names[] = array('new' => $configuration['temp_folder'] . $val . '_' . $file_suffix[$key], 'old' => $val);
                 ${$key} = $val;
             }
         }
     }
     if (sizeof($attachment_file_names) > 0) {
         $mail->add_attachments($attachment_file_names);
     }
 }
 /**
  * Get post data
  */
 $post_data = $_POST;
 if ($configuration['strip_injections'] == true) {
     $post_data = mail_input_validation::check($post_data);
 }
 /**
  * Generate array that contains all form data except
  * the control fields (hidden form fields).
  */
 $all_content_array = $mail->generate_all_content($_POST);
 $all_content = $all_content_array['all_content'];
 $all_content_table = $all_content_array['all_content_table'];
 /**
  * Generate array that contains all form data field
  * names and their counterpart variables ({...}).
  */
 $form_variables = $mail->generate_form_variables($_POST, $txt);
 /**
  * Get environment data