修复获取客户端IP报错的问题

This commit is contained in:
wenquan
2020-04-15 17:10:55 +08:00
parent e7b324a3d8
commit 53d8b4e362
+2 -1
View File
@@ -177,7 +177,8 @@ function get_real_ip()
$ip = FALSE;
}
for ($i = 0; $i < count($ips); $i++) {
if (@!preg_match("^(10|172\.16|192\.168)\.", $ips[$i])) {
$istart = substr($str , 0 , 3);
if ($istart != "10." && $istart != "172" && $istart != "16." && $istart != "192" && $istart != "168"){
$ip = $ips[$i];
break;
}