Skip to content

Commit

Permalink
refs #8030 added a comment that this code may be buggy
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteur committed Aug 12, 2015
1 parent 85e2e53 commit 7d8211f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/IP.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public static function getNonProxyIpFromHeader($default, $proxyHeaders)
// examine proxy headers
foreach ($proxyHeaders as $proxyHeader) {
if (!empty($_SERVER[$proxyHeader])) {
// this may be buggy if someone has proxy IPs and proxy host headers configured as
// `$_SERVER[$proxyHeader]` could be eg $_SERVER['HTTP_X_FORWARDED_HOST'] and
// include an actual host name, not an IP
$proxyIp = self::getLastIpFromList($_SERVER[$proxyHeader], $proxyIps);
if (strlen($proxyIp) && stripos($proxyIp, 'unknown') === false) {
return $proxyIp;
Expand Down

0 comments on commit 7d8211f

Please sign in to comment.