Skip to content

Commit 536209c

Browse files
authored
Allow X-Forwarded-For to have multiple values
1 parent c605e5d commit 536209c

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
@@ -63,6 +63,11 @@ public function getRemoteAddress($ipToLong = false)
6363
if (!$this->remoteAddress) {
6464
return false;
6565
}
66+
67+
if (strpos($this->remoteAddress, ',') !== false) {
68+
$ipList = explode(',', $this->remoteAddress);
69+
$this->remoteAddress = trim(reset($ipList));
70+
}
6671

6772
return $ipToLong ? ip2long($this->remoteAddress) : $this->remoteAddress;
6873
}

0 commit comments

Comments
 (0)