Welcome Guest, Not a member yet? Register   Sign In
Allowed characters config. Why doesn't mine work like it should?
#1

[eluser]FuturShoc[/eluser]
This is what I have in my config file:

Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\'\-\&';

Despite having this as my config entry, code igniter still complains about the extra characters in a uri. I've copied and pasted this and other combinations of the permitted characters string into my config file over and over again and never seem to have the same success as others. I just don't get why I'm different. :-|

I'm using CI 1.6.3, php5.
#2

[eluser]Colin Williams[/eluser]
Hrm.. Have you tried not escaping those certain chars?

Code:
$config['permitted_uri_chars'] = "a-z 0-9~%.:_'-&";
#3

[eluser]FuturShoc[/eluser]
Yep. I certainly have. Escaped, not escaped. Either CI complains when I escape them or it complains that my URI has bad chars. Sad
#4

[eluser]Colin Williams[/eluser]
Here's how CI checks. Obviously you don't need to escape anything yourself, since CI puts in through preg_quote():

Code:
preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)

Use that to debug, I suppose.
#5

[eluser]Matthieu Fauveau[/eluser]
Try to change it to :
Code:
$config['permitted_uri_chars'] = "a-z '&0;-9~%.:_-";

It should work. Changing order of the chars seems to solve issues most of the time.

Edit : the forum won't let me type it correcty the &0; in the code above should read &0; without the last ;
#6

[eluser]FuturShoc[/eluser]
Hmm. Thanks, I'll try that and report back.




Theme © iAndrew 2016 - Forum software by © MyBB