|
发表于 2010-12-6 10:45:42
|
显示全部楼层
回复 60# shadowhung
How to fix it. (assuming codeigniter 1.7)
1) in codeigiter system/libraries open URI.php line 189 you’ll find
if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", rawurlencode($str)))
Change that to:
if ( ! preg_match("|^[".($this->config->item('permitted_uri_chars'))."]+$|i", rawurlencode($str)))
Note we removed the preg_quote(). Now in your system/application/config/config.php file look for line 126 (unless you’ve added a lot to you config will be around there somewhere)
Change the line
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-';
to:
$config['permitted_uri_chars'] = 'a-z 0-9~%\.\:_\-';
we’re now preparing our allowed character string in the config file and skipping preg_quote. And that’s it. Now your uri should work
我按要求改了后可以通過,希望對你有幫助! |
|