mirror of
https://github.com/LyLme/lylme_spage.git
synced 2024-11-17 14:34:08 +08:00
验证IP合法性,防止SQL注入
This commit is contained in:
parent
393ddb6e05
commit
03a80ae8bf
@ -181,7 +181,12 @@ function get_real_ip() {
|
||||
} elseif (isset($_SERVER['REMOTE_ADDR'])) {
|
||||
$real_ip = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
return $real_ip;
|
||||
if (filter_var($real_ip, FILTER_VALIDATE_IP)) {
|
||||
return $real_ip;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
// return $real_ip;
|
||||
}
|
||||
function yan() {
|
||||
$filename = ROOT.'/assets/data/data.dat';
|
||||
|
Loading…
Reference in New Issue
Block a user