|
发表于 2012-2-7 11:39:48
|
显示全部楼层
恩,core目录下。
PHP复制代码
class Ex_URI extends CI_URI {
function __construct () {
parent ::__construct ();
}
function _filter_uri ($str) {
if ($str != '' && $this->config->item('permitted_uri_chars') != '' && $this->config->item('enable_query_strings') == FALSE)
{
// preg_quote() in PHP 5.3 escapes -, so the str_replace() and addition of - to preg_quote() is to maintain backwards
// compatibility as many are unaware of how characters in the permitted_uri_chars will be parsed as a regex pattern
$str = urlencode($str);
if ( ! preg_match("|^[".str_replace(array('\\-', '\-'), '-', preg_quote($this->config->item('permitted_uri_chars'), '-'))."]+$|i", $str))
{
show_error ('The URI you submitted has disallowed characters.', 400);
}
$str = urldecode($str);
}
// Convert programatic characters to entities
$bad = array('$', '(', ')', '%28', '%29');
$good = array('$', '(', ')', '(', ')');
return str_replace($bad, $good, $str);
}
}
复制代码
|
|