问题
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.
回答1:
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~%.:_-';
回答2:
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
来源:https://stackoverflow.com/questions/10400639/permitted-uri-chars-in-codeigniter