permitted_uri_chars in codeigniter
Asked Answered
S

2

2

I am getting en error of "The URI you submitted has disallowed characters" when returning from facebook (using facebook login).

i have set permitted_uri_chars as follows: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-?=';

and my url is: http://www.example/login?state=460f0c9e013ecc3fcbeeas9592ba2cf2e&code=AQDWuAZtPI3UK6vZVL8NL5h0LE28z1jdMRtAbFVjB0IUM7P5WsGFijwlgmzGGZWM37TG0tnCeD8YD-bqCKxilATkyJpiE6UdXhdN0s_s_25S93JRcGyF3inDvLXkadlB6gobStlkguwFlCbaMxV3eWRfo32ExGlN4Mb6OyU2PnWAoRYchG9it0q1KQm3D0N1gSY5_g#_=_

when i change permitted_uri_chars in config as below:

$config['permitted_uri_chars'] = '';

i got below error:

The page you requested was not found.

Swithbart answered 1/5, 2012 at 16:14 Comment(0)
H
4

Welcome to StackOverflow!

permitted_uri_chars are the characters that CodeIgniter accepts in your URI. Directly from the block of text above, in config.php:

This lets you specify with a regular expression which characters are permitted | within your URLs. When someone tries to submit a URL with disallowed | characters they will get a warning message.

Leave blank to allow all characters -- but only if you are insane.

If you want to allow base64 hashes, you'll need to add +=. Change to:

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

Halima answered 1/5, 2012 at 16:30 Comment(1)
should note that certain characters are rendered as their html equivalents like '$' and that can confuse your script. also, hashes dont get along with the uri helper.Eckblad
G
0

Instead of http://www.example/login?state=460f0c9e013e.... etc

try

http://www.example/login/?state=460f0c9e013e.... etc

with a slash after the URL. It worked for me

Godfry answered 10/7, 2015 at 20:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.