permitted_uri_chars in codeigniter

醉酒当歌 提交于 2019-12-24 01:56:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!