When using the CI framework, sometimes you will encounter such a problem. When you open the web page, only the Disallowed Key Characters error message is displayed. Some people say that there are illegal characters in the url. But after making sure that the url is in pure English, the problem still arises. But after clearing browser history and cookies. Refreshing is no problem. sometimes. Open a different browser. Some browsers may have problems. Some won't.
How to solve the Disallowed Key Characters error message in CodeIgniter framework application. Find the Input file under the /system/core folder and copy the following code:
Copy the code The code is as follows:
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;
}
changed to:
Copy code The code is as follows:
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;
}
http://www.bkjia.com/PHPjc/328000.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/328000.htmlTechArticleWhen using the CI framework, sometimes you will encounter such a problem. When you open the web page, only the Disallowed Key Characters error message is displayed. . Some people say that there are illegal characters in the url. But make sure the url is pure English...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn