php批判量过滤post,get敏感な数据
if (get_magic_quotes_gpc()) {
$_GET =tripslashes_array($_GET);
$_POST =tripslashes_array($_POST);
}
functiontripslashes_array(&$array) {
while(list($key,$var) = each($array)) {
if ($key != 'argc' && $key != 'argv' && (strtoupper($key) != $key || ''.intval($key) == "$key")) {
if (is_string($var)) {
$array[$key] =tripslashes($var);
}
if (is_array($var) )) {
$array[$key] =tripslashes_array($var);
}
}
}
return $array;
}