1 $magic_quotes_gpc = get_magic_quotes_gpc();
2 @extract(daddslashes($_COOKIE));
3 @extract(daddslashes($_POST));
4 @extract(daddslashes($_GET));
5  if(!$magic_quotes_gpc) {
6 $_FILES = daddslashes($_FILES);
7 }
8
9
10 function daddslashes($string, $force = 0) {
11 if(!$GLOBALS['magic_quotes_gpc'] || $force) {
12 if(is_array($string)) {
13 foreach($string as $key => $val) {
14 $string[$key] = daddslashes($val, $force);
15 }
16 } else {
17 $string = addslashes($string);
18 }
19 }
20 return $string;
21 }

posted on 2011-01-26 11:38  Dufe王彬  阅读(631)  评论(0编辑  收藏  举报