简体   繁体   English

如何允许不允许的键字符。 在Codeigniter中?

[英]How to allow Disallowed Key Characters. in Codeigniter?

I am getting error with url in codeigniter. 我在codeigniter中收到网址错误。

url string is 网址字串为

coa=1015%20·%20SALARY%20WAGES%20&%20BONUS coa = 1015%20·%20SALARY%20WAGES%20&%20BONUS

which is actually 实际上是

coa=1015 · SALARY WAGES & BONUS. coa = 1015·工资和奖金。 I think & is creating the problem. 我认为&正在制造问题。

I had tried some solutions whihare already accepted answers in stack overflow.But they are for other characters. 我已经尝试过一些解决方案,因为它们已经在堆栈溢出中接受了答案,但是它们是针对其他字符的。

I have tried following things like in config file 我尝试过以下配置文件中的内容

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

change this code to 将此代码更改为

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

Also change function in input.php of system core file as someone has suggested this in stackoverflow. 还应更改系统核心文件的input.php中的功能,因为有人在stackoverflow中提出了此建议。

function _clean_input_keys($str)
{
    if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
    {
        exit('Disallowed Key Characters.');
    }

    return $str;
}

But still i am facing the issue. 但是我仍然面临这个问题。

So can you please suggest me how can i solve this error. 因此,您能建议我如何解决此错误。

Thanks 谢谢

Leave blank to allow all characters as following 留空以允许所有字符如下

$config['permitted_uri_chars'] = '';

But It has security issue. 但是它有安全性问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM