Solution for URI issue anyone? |
[eluser]JDG[/eluser]
I have just decided to make the change from ZF to CI but I have encountered my first problem. I have a fresh install and have tired to add my first controller and get the error message "The URI you submitted has disallowed characters." I am using php 5.3 and searched around but wasn't able to find a solution. I guess my first question is, is there a solution? And the second is a request for guidance to solving this is possible. Cheers, JD
[eluser]JDG[/eluser]
This is what it looks like ... http://example.com/index.php/products nothing fancy really. Cheers,
[eluser]JDG[/eluser]
I found the solution. Minor change really all i did was the following. In URI.php line 189: Code: if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) replace with: Code: if ( ! preg_match("|^[".str_replace('\\-', '-', preg_quote($this->config->item('permitted_uri_chars')))."]+$|i", $str)) cheers
[eluser]louis w[/eluser]
You shouldn't have to make any changes to URI.php. Out of the box CI works as expected. I would suggest reverting back to the base install of CI and tracking down the actual problem. Did you change the config value for permitted_uri_chars in your config?
[eluser]Pascal Kriete[/eluser]
I'm afraid he has found the actual problem. In PHP 5.3 preg_quote was changed to escape the dash, so character ranges won't work. I can understand their reasoning even if I don't agree with changing behavior that has been around for roughly 7 (8?) years. I haven't upgraded to 5.3 yet and I don't think anyone on the team has, but we'll get a fix into the SVN when that happens. Thanks.
|
Welcome Guest, Not a member yet? Register Sign In |