Open the CI framework of the source code is not difficult to find, in the CI of the core input class has such a function:
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;
}
This is filtered so that the error is thrown
We rewrite this method in the core of application.
Name a my_input.php (prefix My_ can be customized in config.php), and then add the following code
Copy Code code as follows:
Class Ai_input extends Ci_input {
Constructors
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;
}
}