Welcome Guest, Not a member yet? Register   Sign In
Once again permitted uri chars. Take a look please

I have url like this: SITE_URL_HERE/index.php/pages/images/set_as_background/body-bgOLD.jpg

And it shows error 'The URI you submitted has disallowed characters.' on a server, but on localhost (Windows) everything is OK. In this URI problem arises due to '-' character.

Where can be the problem?

P.S.: permitted_uri_chars directive is default:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-';
I'm running newest CI 1.6.1

Perhaps OLD is not in the permitted set A-Z is required

hmm sorry but it's not the case :// I tried to change configuration to:
$config['permitted_uri_chars'] = 'a-zA-Z 0-9~%.:_-';
but warning message still there.
Then I deleted OLD and problem still exists.
I don't know what to think honestly..

try escaping the - with a backslash in your config file. character set should then be
$config['permitted_uri_chars'] = 'a-zA-Z 0-9~%.:_\-';
this then makes the character a true character for the preg_match() in system/libraries/URI.php method _filter_uri().

this char is not special regular expression char and isn't escaped by the preg_quote() in the method, but indicates a charater range because in between [ and ] ( a character class).

hope this helps.

if you look at the svn config file it's the same as shiggles (i remember it because of the comment Smile )

it worked ;-) thank you guys ..

and tell me how could I add 2 more chars '|' and '='. I need because base64_encode generates them..
If i simply add as this
$config['permitted_uri_chars'] = 'a-zA-Z 0-9~%.:_\-|=';
my earlier problem arises again Smile without them it's okay now Smile
I definitely need more knowledge about regular expressions :/ but it's very complicated Smile

[eluser]Noah David[/eluser]
Try this:

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

Basically, put a \ (slash) before any character you want a LITERAL match for. Also, look for a program called RegexBuddy. It might help you out when trying to create your own regex strings. Cheers!

Theme © iAndrew 2016 - Forum software by © MyBB