mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
fix getting original ip
This commit is contained in:
parent
fbd91d33a4
commit
b82b5f6a53
1 changed files with 4 additions and 3 deletions
|
@ -36,9 +36,10 @@ class Request
|
|||
|
||||
public static function getOriginalIp(): string
|
||||
{
|
||||
return isset($_SERVER['HTTP_X_FORWARDED_FOR']) ?
|
||||
$_SERVER['HTTP_X_FORWARDED_FOR'] :
|
||||
(isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '');
|
||||
return isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] :
|
||||
(isset($_SERVER['HTTP_X_FORWARDED_FOR']) ?
|
||||
trim(explode(',',$_SERVER['HTTP_X_FORWARDED_FOR'])[0]) :
|
||||
(isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''));
|
||||
}
|
||||
|
||||
public static function getUserAgent(): string
|
||||
|
|
Loading…
Add table
Reference in a new issue