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. Bo E baientertainment City
Solution: the error message "disallowed key characters" appears in the codeigniter framework application. Find the input file in the core folder and run the following code:
function _clean_input_keys($str){if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)){exit(‘Disallowed Key Characters.‘);}// Clean UTF-8 if supportedif (UTF8_ENABLED === TRUE){$str = $this->uni->clean_string($str);}return $str;}
Changed to this:
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 supportedif (UTF8_ENABLED === TRUE){$str = $this->uni->clean_string($str);}return $str; }
Or change:
function _clean_input_keys($str){if(preg_match("/^,_[a-z0-9:_\/-]+$/",$str)){$str = preg_replace("/,_/","",$str); } if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)) { exit(‘Disallowed Key Characters.‘.$str); }return $str;}
This is probably the case ~ Keep a record.
Error message about solving disallowed key characters of Ci framework