How to solve the CI framework's DisallowedKeyCharacters error prompt _ PHP Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.