Home > Backend Development > PHP Tutorial > How to solve the Disallowed Key Characters error message of the CI framework_PHP tutorial

How to solve the Disallowed Key Characters error message of the CI framework_PHP tutorial

WBOY
Release: 2016-07-21 15:01:22
Original
923 people have browsed it

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...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template