Open the CI framework source code is not difficult to find, in the CI core input class has such a function:
Copy CodeThe 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;
}
This is a filter, so throw an error
We can rewrite this method in the core of application
Name a my_input.php (prefix My_ can be customized in config.php), then add the following code
Copy the Code code as follows:
Class Ai_input extends Ci_input {
constructor function
function __construct () {
Parent::__construct ();
}
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;
}
}
http://www.bkjia.com/PHPjc/756990.html www.bkjia.com true http://www.bkjia.com/PHPjc/756990.html techarticle Open the CI Framework source code is not difficult to find, in the CI core input class has such a function: Copy code is as follows: function _clean_input_keys ($STR) {if (! Preg_match ("/^[a-z0-9:_\/ ...