This article describes how to solve the problem of DisallowedKeyCharacters error in the CodeIgniter framework. For more information, see the CI framework.
When using the CI framework, you may encounter such a problem. when you open a webpage, only the error message "Disallowed Key Characters" 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;
}