fix: PHP 8 compatibility warnings and fatal errors
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/5ac91d14-7688-4ab2-9065-10d4a361750f Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
4571837eeb
commit
7a16fb299f
6 changed files with 8 additions and 12 deletions
|
|
@ -630,6 +630,7 @@ function get_game_selector($os, $game_cfgs, $home_cfg_id = FALSE)
|
|||
}
|
||||
|
||||
function getClientIPAddress(){
|
||||
$ip = null;
|
||||
if(isset($_SERVER['HTTP_CF_CONNECTING_IP']) && !empty($_SERVER['HTTP_CF_CONNECTING_IP'])){
|
||||
$ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
|
||||
}else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
|
||||
|
|
@ -638,7 +639,7 @@ function getClientIPAddress(){
|
|||
$ip = $_SERVER['HTTP_X_REAL_IP'];
|
||||
}
|
||||
|
||||
if(filter_var($ip, FILTER_VALIDATE_IP)){
|
||||
if(isset($ip) && filter_var($ip, FILTER_VALIDATE_IP)){
|
||||
return $ip;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue