Welcome Guest, Not a member yet? Register   Sign In
Solution for URI issue anyone?

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.



What does your URI look like?

This is what it looks like ...


nothing fancy really.


I found the solution. Minor change really all i did was the following.

In URI.php line 189:
if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str))

replace with:
if ( ! preg_match("|^[".str_replace('\\-', '-', preg_quote($this->config->item('permitted_uri_chars')))."]+$|i", $str))


[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.


[eluser]louis w[/eluser]
Wow, have to agree with you Pascal.

After a format and installing a new Wampserver, I came across the same bug (found the solution on this blog)

I did the manual changes myself for now, but it would be nice if there was an update in the svn ^^

Thank a lot it helped.

Theme © iAndrew 2016 - Forum software by © MyBB