How to solve the DisallowedKeyCharacters error message of the CI framework. When using the CI framework, you may encounter such a problem. when you open a webpage, only the error message "DisallowedKeyCharacters" is displayed. Some people say that the url contains invalid characters. However, when you determine that the url is a pure English CI framework, you may encounter such a problem. when you open the webpage, only the Disallowed Key Characters error message is displayed. Some people say that the url contains invalid characters. But make sure that the url is in English only. However, after clearing the browser history and cookies. Refresh. Sometimes. Open different browsers. Some browsers have problems. Some won't.
Solution: The error message "Disallowed Key Characters" appears in the CodeIgniter framework application. Find the Input file in the/system/core folder and run the following 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:
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;
}
Disallowed Key Characters error message. Some people say that the url contains invalid characters. But make sure the url is pure English...