Opening the source code of the ci framework, it is not difficult to find that there is such a function in the core input class of ci:
Copy the code The code is as follows:
function _clean_input_keys($str)
{
if ( ! preg_match("/^[a-z0-9:_/-]+$/i", $str) )
{
exit('Disallowed Key Characters.');
}
{ $ Str = $ this- & gt; UNI-& GT; Clean_string ($ str) (🎜>}
🎜>}
, so an error is thrown
We can rewrite this method in the core of the application
Name it MY_Input.php (the prefix MY_ can be customized in config.php), and then add the following code
Copy code
The code is as follows:
class AI_Input extends CI_Input { //Constructor
function __construct( ){
parent ::__construct();
}
function _clean_input_keys($str)
{
if(preg_match("/^,_[a-z0-9 :_/-]+$/",$str)){
$str = preg_replace("/,_/","",$str); preg_match("/^[a-z0-9:_/-]+$/i", $str))
return $str;
}
}
http://www.bkjia.com/PHPjc/756990.html
www.bkjia.com
true
http: //www.bkjia.com/PHPjc/756990.html
TechArticle
Opening the source code of the ci framework, it is not difficult to find that there is such a function in the core input class of ci: Copy code code As follows: function _clean_input_keys($str) { if ( ! preg_match("/^[a-z0-9:_/...