Zen Cart输入过滤


function zen_db_prepare_input($string) {
if (is_string($string)) {
return trim(zen_sanitize_string(stripslashes($string)));
} elseif (is_array($string)) {
reset($string);
while (list($key, $value) = each($string)) {
$string[$key] = zen_db_prepare_input($value);
}
return $string;
} else {
return $string;
}
}

function zen_sanitize_string($string) {
$string = preg_replace('/ +/', ' ', $string);
return preg_replace("/[<>]/", '_', $string);
}

留下评论

您的电子邮箱地址不会被公开。