|
解決 CodeIgniter 框架應(yīng)用中,出現(xiàn)Disallowed Key Characters錯誤提示的方法。找到/system/core文件夾下的Input文件,將下面的代碼:
復(fù)制代碼 代碼如下:
function _clean_input_keys($str)
{
if ( ! preg_match("/^[a-z0-9:_//-]+$/i", $str))
{
exit('Disallowed Key Characters.');
}
// Clean UTF-8 if supported
if (UTF8_ENABLED === TRUE)
{
$str = $this->uni->clean_string($str);
}
return $str;
}
改為:
復(fù)制代碼 代碼如下:
function _clean_input_keys($str)
{
$config = &get_config('config');
if ( ! preg_match("/^[".$config['permitted_uri_chars']."]+$/i", rawurlencode($str)))
{
exit('Disallowed Key Characters.');
}
// Clean UTF-8 if supported
if (UTF8_ENABLED === TRUE)
{
$str = $this->uni->clean_string($str);
}
return $str;
}
php技術(shù):如何解決CI框架的Disallowed Key Characters錯誤提示,轉(zhuǎn)載需保留來源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。