diff --git a/lib/core/Core.php b/lib/core/Core.php index 1d46d91c99dfb1df46489d10e78f6e3faaa3bc8a..229d8ee7582ec71825337010e9aa7108d08ca90f 100644 --- a/lib/core/Core.php +++ b/lib/core/Core.php @@ -103,19 +103,24 @@ function PREXss($data) print_r($data); echo "";die; } + + function addslashes_deep($value) { + $value = is_array($value) ? array_map('addslashes_deep', $value) : addslashes($value); + return $value; + } //get 获取 function get($name) { - return empty($_GET[$name])?"":$_GET[$name]; + return empty($_GET[$name])?"":addslashes_deep($_GET[$name]); } //post获取 function post($name="") { if(empty($name)) { - return empty($_POST)?"":$_POST; + return empty($_POST)?"":addslashes_deep($_POST); }else{ - return empty($_POST[$name])?"":$_POST[$name]; + return empty($_POST[$name])?"":addslashes_deep($_POST[$name]); } } //ip获取