CodeIgniter Forums
permitted_uri_chars and $_GET - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: permitted_uri_chars and $_GET (/showthread.php?tid=6007)

Pages: 1 2 3 4 5


permitted_uri_chars and $_GET - El Forum - 04-20-2009

[eluser]sholsinger[/eluser]
[quote author="Edemilson Lima" date="1202844394"]Try this:
Code:
"a-z 0-9~%.:_\?&=-"
I am not sure if is the case here, but the question mark "?" is a special character in regular expressions. It makes the expression to "ask" if the caracter before it exist or not in the string. If you need to use any special character as a normal character, you must escape them with a "\".[/quote]

Actually, in the URI Class of CI 1.7.1, the value for 'permitted_uri_chars' is sent through preg_quote() which will escape any special characters in the string. (Except the '-'). So by adding '\' to the string it will become:
Code:
'a-z 0-9~%\.:_\\\?&\=-'
Therefore one should not escape special characters in this string as that is handled automatically by preg_quote().


permitted_uri_chars and $_GET - El Forum - 04-21-2009

[eluser]sholsinger[/eluser]
[quote author="taewoo" date="1203583661"]So how do i enable "+"?

I tried this (recommended from Derek Allard's page):

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

NO luck either... same error[/quote]

taewoo, you need to also allow the comma. 'San+Jose,+CA'