security->xss_clean($str, $is_image); } } // ------------------------------------------------------------------------ if ( ! function_exists('sanitize_filename')) { /** * Sanitize Filename * * @param string * @return string */ function sanitize_filename($filename) { $CI =& get_instance(); return $CI->security->sanitize_filename($filename); } } // -------------------------------------------------------------------- if ( ! function_exists('do_hash')) { /** * Hash encode a string * * @todo Remove in version 3.1+. * @deprecated 3.0.0 Use PHP's native hash() instead. * @param string $str * @param string $type = 'sha1' * @return string */ function do_hash($str, $type = 'sha1') { if ( ! in_array(strtolower($type), hash_algos())) { $type = 'md5'; } return hash($type, $str); } } // ------------------------------------------------------------------------ if ( ! function_exists('strip_image_tags')) { /** * Strip Image Tags * * @param string * @return string */ function strip_image_tags($str) { $CI =& get_instance(); return $CI->security->strip_image_tags($str); } } // ------------------------------------------------------------------------ if ( ! function_exists('encode_php_tags')) { /** * Convert PHP tags to entities * * @param string * @return string */ function encode_php_tags($str) { return str_replace(array(''), array('<?', '?>'), $str); } } /* End of file security_helper.php */ /* Location: ./system/helpers/security_helper.php */