/** * Cleans against XSS. * Info: use it on showing your request data. * * @param string $string String to check * @param string $charset Character set (default ISO-8859-1) * * @return string $value Sanitized string */ public static function cleanXss($string, $charset = 'ISO-8859-1') { return \Pimf\Util\Character\Clean::xss($string, $charset); }
/** * Never ever (ever) trust foreign input introduced to your PHP code! * * @param mixed $rawData * * @return mixed */ public static function filter($rawData) { return is_array($rawData) ? array_map(function ($value) { return \Pimf\Util\Character\Clean::xss($value); }, $rawData) : \Pimf\Util\Character\Clean::xss($rawData); }