URI段作为函数的参数:传递逗号,+,日期格式为允许的URI段?

时间:2013-11-06 05:30:51

标签: php codeigniter codeigniter-routing

您能否将日期时间格式的逗号或+符号或数据作为codeigniter中URI段的参数传递? 比如通过ajax调用一个url:controller / function / argument1 / argument2

现在,从前端调用时,此参数1是否包含+,(,),逗号等字符?看起来不是。我尝试通过URI段将地址变量传递给函数,但是地址中出现的+符号,逗号会产生错误。从前端传递的日期格式也是如此。这是限制还是有解决办法?

1 个答案:

答案 0 :(得分:2)

如果您查看config.php文件夹中的application/config文件,可以找到以下内容:

|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| 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.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible.  By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

所以,基本上,你可以改变它以接受你想要的任何符号, 但我真的不知道是什么类型的理由可以让你通过你的uri上面的上述允许符号。

相关问题