Skip to content

Commit b96bbcd

Browse files
committed
Allow X-Forwarded-For to have multiple values
1 parent 9b977b0 commit b96bbcd

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)