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
*
* @param string
* @param string
* @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)
{
return preg_replace(array('##', '##'), '\\1', $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('<?php', '<?PHP', '<?', '?>'), $str);
}
}
/* End of file security_helper.php */
/* Location: ./system/helpers/security_helper.php */