src/Suki/Data.php
public function sanitize($var)
	{
		global $smcFunc;

		if (is_array($var))
		{
			foreach ($var as $k => $v)
				$var[$k] = $this->sanitize($v);

			return $var;
		}

		else
		{
			$var = (string) $smcFunc['htmltrim']($smcFunc['htmlspecialchars']($var), ENT_QUOTES);

			if (ctype_digit($var))
				$var = (int) $var;

			if (empty($var))
				$var = false;
		}

		return $var;
	}
public function sanitize($var)
	{
		global $smcFunc;

		if (is_array($var))
		{
			foreach ($var as $k => $v)
				$var[$k] = $this->sanitize($v);

			return $var;
		}

		else
		{
			$var = (string) $smcFunc['htmltrim']($smcFunc['htmlspecialchars']($var), ENT_QUOTES);

			if (ctype_digit($var))
				$var = (int) $var;

			if (empty($var))
				$var = false;
		}

		return $var;
	}
public function sanitize ( $ var ) { global $ smcFunc ; if ( is_array ( $ var ) ) { foreach ( $ var as $ k => $ v ) $ var [ $ k ] = $ this -> sanitize ( $ v ) ; return $ var ; } else { $ var = ( string ) $ smcFunc [ 'htmltrim' ] ( $ smcFunc [ 'htmlspecialchars' ] ( $ var ) , ENT_QUOTES ) ; if ( ctype_digit ( $ var ) ) $ var = ( int ) $ var ; if ( empty ( $ var ) ) $ var = false ; } return $ var ; }
Sanitizes a var. Recursive.
Treats any var as a string and cast it as an integer if necessary.
@param mixed $var The var you want to sanitize
@access public
@return mixed
Sanitizes a var . Recursive . Treats any var as a string and cast it as an integer if necessary .