如何允许在CodeIgniter URL中使用URI编码的字符? [英] How do you allow URI encoded characters in CodeIgniter URLs?
问题描述
我使用 CodeIgniter 1.7.1 。我允许的URI字符设置为:
I am using CodeIgniter 1.7.1. My permitted URI characters are set as such:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_()@&\-';
当我输入地址,例如 http://website.com/index.php/controller/method/test%21 ,该网页不会加载并给我错误
When I type a address like http://website.com/index.php/controller/method/test%21, the page does not load and gives me the error:
代码点击器:发生错误您提交的URI包含
不允许的字符。
Code igniter: An Error Was EncounteredThe URI you submitted has disallowed characters.
我不明白。 %20
(空格),但%21
(感叹号)
I don't understand. %20
(space) is allowed, but %21
(exclamation mark) is not.
推荐答案
%21解析成!在codeigniter。所以codeigniter不支持这个请! into permitted uri cofig file:
%21 parse into ! in codeigniter. So codeigniter doesn't support this please ! into permitted uri cofig file :
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_()@&\-!';
这篇关于如何允许在CodeIgniter URL中使用URI编码的字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!