When I upgrade my Xampp to version 1.7.3 from 1.6.6 and I try to run my application with Code Igniter, I’ve got some problem. One Of them is “The URI you submitted has disallowed characters”. Xampp 1.7.3 upgraded my php dev environment to 5.3.1 . A few things have changed since then. Problem in function set_magic_quotes_runtime() was fixed.
I search at google to fix my problem about URL has disallowed character and now I got it. Now I wanna share for u about this problem. this is the steps to fix it. I used codeigniter 1.7
1. We’ll remove the preg_quote(). In codeigniter system/libraries open url.php line 189 you’ll find
if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", rawurlencode($str)))
if ( ! preg_match("|^[".($this->config->item('permitted_uri_chars'))."]+$|i", rawurlencode($str)))
2. Now in your system/application/config/config.php file look in line 126 (unless you’ve added a lot to you will be around there somewhere). you will find
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-';
$config['permitted_uri_chars'] = 'a-z 0-9~%\.\:_\-';
This problem show me that the CodeIgniter check url for allowed list of character to something usable in a regular expression. Now the minus “-”, or I’d call it a dash (but I know there is a longer character for that) gets escaped in preg_quote with a backslash “\”. That cause the expression “a-z 0-9″ to be converted to “a\-z 0\-9″ which will not work in a regex.
oke,,hope that’s help u,happy coding ^_^
a Web Programmer in IT Consultant Company... Web Programmer Read more from this author