Sanitize the inputs.

@return array
969951
protected function sanitize()
    {
        return [
            'slug'      => Str::slug($this->get($this->has('slug') ? 'slug' : 'title', '')),
            'seo_title' => $this->get(empty($this->get('seo_title')) ? 'title' : 'seo_title'),
        ];
    }
1006208
public static function clearInput($input)
    {
        if (is_array($input)) {
            foreach ($input as $key => $value) {
                if (!isset($value) || $value === '') {
                    unset($input[$key]);
                }
            }

            return $input;
        }

        return $input;
    }
818884
public static function clean($input)
    {
        // handle input of type array
        if (is_array($input)) {
            foreach ($input as $idx => $val) {
                $input[$idx] = self::clean($val);
            }
            return $input;
        }

        if (!is_string($input) || $input == '') {
            return $input;
        }

        // iconv/mbstring are much faster (especially with long strings)
        if (function_exists('mb_convert_encoding')) {
            $msch = mb_substitute_character();
            mb_substitute_character('none');
            $res = mb_convert_encoding($input, 'UTF-8', 'UTF-8');
            mb_substitute_character($msch);

            if ($res !== false) {
                return $res;
            }
        }

        if (function_exists('iconv')) {
            if (($res = @iconv('UTF-8', 'UTF-8//IGNORE', $input)) !== false) {
                return $res;
            }
        }

        $seq    = '';
        $out    = '';
        $regexp = '/^('.
//          '[\x00-\x7F]'.                                  // UTF8-1
            '|[\xC2-\xDF][\x80-\xBF]'.                      // UTF8-2
            '|\xE0[\xA0-\xBF][\x80-\xBF]'.                  // UTF8-3
            '|[\xE1-\xEC][\x80-\xBF][\x80-\xBF]'.           // UTF8-3
            '|\xED[\x80-\x9F][\x80-\xBF]'.                  // UTF8-3
            '|[\xEE-\xEF][\x80-\xBF][\x80-\xBF]'.           // UTF8-3
            '|\xF0[\x90-\xBF][\x80-\xBF][\x80-\xBF]'.       // UTF8-4
            '|[\xF1-\xF3][\x80-\xBF][\x80-\xBF][\x80-\xBF]'.// UTF8-4
            '|\xF4[\x80-\x8F][\x80-\xBF][\x80-\xBF]'.       // UTF8-4
            ')$/';

        for ($i = 0, $len = strlen($input); $i < $len; $i++) {
            $chr = $input[$i];
            $ord = ord($chr);

            // 1-byte character
            if ($ord <= 0x7F) {
                if ($seq !== '') {
                    $out .= preg_match($regexp, $seq) ? $seq : '';
                    $seq = '';
                }

                $out .= $chr;
            }
            // first byte of multibyte sequence
            else if ($ord >= 0xC0) {
                if ($seq !== '') {
                    $out .= preg_match($regexp, $seq) ? $seq : '';
                    $seq = '';
                }

                $seq = $chr;
            }
            // next byte of multibyte sequence
            else if ($seq !== '') {
                $seq .= $chr;
            }
        }

        if ($seq !== '') {
            $out .= preg_match($regexp, $seq) ? $seq : '';
        }

        return $out;
    }
941200
public static function clean_input()
	{
		$_GET		= static::clean($_GET);
		$_POST		= static::clean($_POST);
		$_COOKIE	= static::clean($_COOKIE);
	}
24131
public static function sanitizeArray(&$arr)
    {
        foreach ($arr as $k => $v) {
            if (is_string($v)) {
                $arr[$k] = self::sanitizeInput($v);
            }
        }
    }
603794
public function getUserInput(): array
    {
        $data = [
            'email' => $this->input('email'),
            'is_active' => $this->filled('is_active') ? 1 : 0,
        ];

        if ($this->input('password')) {
            Arr::set($data, 'password', $this->input('password'));
        }

        return $data;
    }
532107
final public function sanitizedAttributes () : array
	{
        $dbObject 			= Database::getInstance();
		$cleanAttributes 	= [];
		foreach ($this->attributes() as $key => $value):
			if (isset($value))
				$cleanAttributes[$key] = $dbObject->escapeValue($value);
		endforeach;
		return $cleanAttributes;
	}
1086939
public function sanitize( $input ) {
		$new_input = [];
		foreach ( array_keys( (array) $input ) as $id ) {
			$new_input[ sanitize_file_name( $id ) ] = sanitize_text_field( $input[ $id ] );
		}

		return $new_input;
	}
1141650
public function sanitize($input)
    {
        foreach ($this->rawRules as $rule) {
            if ($rule instanceof Attributes) {
                $config = [
                    'remainder' => $this->remainder,
                    'recursive' => $this->recursive
                ];
                Instance::configure($rule, $config);
                return $rule->sanitize($input);
            }
            $input = $rule->sanitize($input);

            if ($rule->recursive && (is_array($input) || is_object($input))) {
                $config['attributes'] = $this;
                return (new Attributes($config))->sanitize($input);
            }
        }

        return $input;
    }
1060720
public function sanitize_callback() {
		return function( $value ) {
			if ( ! is_array( $value ) ) {
				$value = explode( ',', $value );
			}

			$sanitized_values = [];

			foreach ( $value as $v ) {
				if ( ! array_key_exists( $v, $this->args['choices'] ) ) {
					continue;
				}
				$sanitized_values[] = $v;
			}

			$sanitized_values = array_map( 'sanitize_text_field', $sanitized_values );
			return implode( ',', $sanitized_values );
		};
	}
1245929
public function sanitize(string $input) : string
    {
        $input = $this->_connection->getConnection()->quote($input);

        return substr($input, 1, -1);
    }
72922
private function _sanitize_class() {
		if ( isset( $this->attr['class'] ) && is_string( $this->attr['class'] ) ) {
			$this->attr['class'] = explode( ' ', $this->attr['class'] );
		}
		if ( !isset( $this->attr['class'] ) || !is_array( $this->attr['class'] ) ) {
			$this->attr['class'] = array();
		}
	}
267970
public function filteredInput()
    {
        $files = $this->arrayFilterRecursive(Request::file());
        $input = array_replace_recursive(Request::input(), $files);

        return Library\Utils\Collection::nullEmpties($input);
    }
719436
public static function sanitize($value)
    {
        if (is_array($value) || is_object($value))
        {
            foreach ($value as $key => $val)
            {
                $value[$key] = self::sanitize($val);
            }
        }
        elseif (is_string($value))
        {
            $value = stripslashes($value);
            if (false !== strpos($value, "\r"))
            {
                $value = str_replace([
                    "\r\n",
                    "\r"
                ], "\n", $value);
            }
        }

        return $value;
    }
456465
private function sanitize($value)
    {
        if ($value === null) {
            $value = 'null';
        }

        if (is_array($value)) {
            $value = 'array';
        }

        if (is_bool($value)) {
            $value = $value
                ? 'true'
                : 'false';
        }

        return $value;
    }
159743
public function sanitize()
    {
        $value = filter_var($this->value, FILTER_SANITIZE_EMAIL, FILTER_NULL_ON_FAILURE);

        if (null === $value) {
            throw FailedToSanitize::fromValueForClass($this->value, $this);
        }

        return $value;
    }
743799
public function sanitize($data)
    {
        if (is_array($data)) {
            $newArray = [];
            foreach ($data as $key => $value) {
                $newArray[$this->cleanKeys($key)] = $this->sanitize($value);
            }

            return $newArray;
        }

        if ($this->magicQuotesGpc === true) {
            // Get rid of those pesky magic quotes!
            $data = stripslashes($data);
        }

        return $this->xssClean($data);
    }