enhance xss protection

This commit is contained in:
Namhyeon Go 2018-12-31 10:41:23 +09:00
parent 468638f994
commit 0c3a75bf12

View File

@ -65,12 +65,13 @@ if(!function_exists("read_requests")) {
}
// with security module
\if(function_exists("get_clean_xss")) {
foreach($requests['_GET'] as $k=>$v) {
if(is_string($v)) {
$requests['_GET'][$k] = get_clean_xss($v);
}
}
$protect_methods = array("_ALL", "_GET", "_POST", "_JSON");
if(function_exists("get_clean_xss")) {
foreach($protect_methods as $method) {
foreach($requests[$method] as $k=>$v) {
$requests[$method][$k] = is_string($v) ? get_clean_xss($v) : $v;
}
}
}
// set alias