How to solve the CI frame disallowed Key characters error tips _php tips

Source: Internet
Author: User
When you use the CI framework, there is sometimes a problem when you open a Web page and display only the disallowed Key Characters error message. Some people say that there are illegal characters in the URL. But the confirmation URL is pure English, the problem still comes out. But after emptying the browser history and cookies. Refresh is no problem. Sometimes. Open a different browser. Some browsers may have problems. Some will not.

To solve the CodeIgniter framework application, the disallowed Key characters error prompts are presented. Locate the input file under the/system/core folder, and the following code:
Copy Code code 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;
}

replaced by:
Copy Code code 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;
}

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.