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 issues. Some won't.
How to solve the Disallowed Key Characters error message in the CodeIgniter framework application. Find the Input file in the /system/core folder and add the following code:
<span function</span> _clean_input_keys(<span $str</span><span ) { </span><span if</span> ( ! <span preg_match</span>("/^[a-z0-9:_\/-]+$/i", <span $str</span><span )) { </span><span exit</span>('Disallowed Key Characters.'<span ); } </span><span //</span><span Clean UTF-8 if supported</span> <span if</span> (UTF8_ENABLED === <span TRUE</span><span ) { </span><span $str</span> = <span $this</span>->uni->clean_string(<span $str</span><span ); } </span><span return</span> <span $str</span><span ; }</span>
changed to:
<span function</span> _clean_input_keys(<span $str</span><span ) { </span><span $config</span> = &get_config('config'<span ); </span><span if</span> ( ! <span preg_match</span>("/^[".<span $config</span>['permitted_uri_chars']."]+$/i", <span rawurlencode</span>(<span $str</span><span ))) { </span><span exit</span>('Disallowed Key Characters.'<span ); } </span><span //</span><span Clean UTF-8 if supported</span> <span if</span> (UTF8_ENABLED === <span TRUE</span><span ) { </span><span $str</span> = <span $this</span>->uni->clean_string(<span $str</span><span ); } </span><span return</span> <span $str</span><span ; } </span>
Reference: http://www.nowamagic.net/librarys/veda/detail/1699