-
- //PHP filters disabled characters before entering the database (php code function)
-
-
- function safe_str($str){
- $array=array('receive.php','select','insert', 'update','delete','union','into','load_file','outfile');
- if(!is_array($str)){
- foreach($array as $v){
- $str= preg_replace("#({$v})#i","-\$小贝-",$str);
- }
- //$str=preg_replace("![][xX]([A-Fa- f0-9])!","x \$小贝",$str);
- $str=str_replace("'",''',$str);
- $str=str_replace('"' ,'"',$str);
- $str=str_replace("--",'-',$str);
- $str=str_replace("\*",'\-*',$str );
- $str=str_replace("\\",'monxin_backslash',$str);
- $r=$str;
- }else{
- $r=array();
- foreach($str as $key=> ;$value){
- //$key=safe_str($key);
- $r[$key]=safe_str($value);
- }
- }
-
- return $r;
- }
-
-
Copy code
|