Skip to content

Commit a2af98a

Browse files
author
Oleksii Korshenko
authored
MAGETWO-66797: Allow X-Forwarded-For to have multiple values #8409
2 parents e56ad56 + ba27146 commit a2af98a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: lib/internal/Magento/Framework/HTTP/PhpEnvironment/RemoteAddress.php

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ public function getRemoteAddress($ipToLong = false)
6464
return false;
6565
}
6666

67+
if (strpos($this->remoteAddress, ',') !== false) {
68+
$ipList = explode(',', $this->remoteAddress);
69+
$this->remoteAddress = trim(reset($ipList));
70+
}
71+
6772
return $ipToLong ? ip2long($this->remoteAddress) : $this->remoteAddress;
6873
}
6974

0 commit comments

Comments
 (0)