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

[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
#2

[eluser]davidbehler[/eluser]
What does your URI look like?
#3

[eluser]JDG[/eluser]
This is what it looks like ...

http://example.com/index.php/products

nothing fancy really.

Cheers,
#4

[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
#5

[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?
#6

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

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

[eluser]Bramme[/eluser]
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 ^^
#9

[eluser]bluepicaso[/eluser]
Thank a lot it helped.




Theme © iAndrew 2016 - Forum software by © MyBB