CodeIgniter Forums
Once again permitted uri chars. Take a look please - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Once again permitted uri chars. Take a look please (/thread-6464.html)



Once again permitted uri chars. Take a look please - El Forum - 02-28-2008

[eluser]PoWah[/eluser]
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:
Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-';
I'm running newest CI 1.6.1


Once again permitted uri chars. Take a look please - El Forum - 02-28-2008

[eluser]wiredesignz[/eluser]
Perhaps OLD is not in the permitted set A-Z is required


Once again permitted uri chars. Take a look please - El Forum - 02-28-2008

[eluser]PoWah[/eluser]
hmm sorry but it's not the case :// I tried to change configuration to:
Code:
$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..


Once again permitted uri chars. Take a look please - El Forum - 02-28-2008

[eluser]Unknown[/eluser]
howdy,
try escaping the - with a backslash in your config file. character set should then be
Code:
$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.


Once again permitted uri chars. Take a look please - El Forum - 02-28-2008

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


Once again permitted uri chars. Take a look please - El Forum - 02-28-2008

[eluser]PoWah[/eluser]
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
Code:
$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


Once again permitted uri chars. Take a look please - El Forum - 02-29-2008

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

Code:
$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!