Skip to content

Commit 5b21226

Browse files
committed
Fix $_SERVER field
1 parent 22e69e7 commit 5b21226

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/php/com/selfcoders/phpdyndns/IPUtils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ class IPUtils
55
{
66
public static function getClientIP($trustedProxies = [])
77
{
8-
if (isset($_SERVER["X_FORWARDED_FOR"]) and in_array($_SERVER["REMOTE_ADDR"], $trustedProxies)) {
9-
$ips = explode(",", $_SERVER["X_FORWARDED_FOR"]);
8+
if (isset($_SERVER["HTTP_X_FORWARDED_FOR"]) and in_array($_SERVER["REMOTE_ADDR"], $trustedProxies)) {
9+
$ips = explode(",", $_SERVER["HTTP_X_FORWARDED_FOR"]);
1010
return trim(end($ips));
1111
}
1212

0 commit comments

Comments
 (0)