Microweber\Utils\Database::clean_input PHP Method

clean_input() public method

public clean_input ( $input )
    public function clean_input($input)
    {
        if (is_array($input)) {
            $output = array();
            foreach ($input as $var => $val) {
                $output[$var] = $this->clean_input($val);
            }
        } elseif (is_string($input)) {
            $search = array('@<script[^>]*?>.*?</script>@si', '@<![\\s\\S]*?--[ \\t\\n\\r]*>@');
            if (is_string($input)) {
                $output = preg_replace($search, '', $input);
            } else {
                $output = $input;
            }
        } else {
            return $input;
        }
        return $output;
    }