Skip to content

Commit

Permalink
Merge pull request #557 from FatchipRobert/MAG2-318-ClientIp-behind-p…
Browse files Browse the repository at this point in the history
…roxy

MAG2-318 - Fixed client ip getter
  • Loading branch information
janteuber authored Sep 13, 2024
2 parents 599eb79 + 036250f commit 8b9c6ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Helper/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ public function getEncoding()
public function getRemoteIp()
{
$blProxyMode = (bool)$this->getConfigParam('proxy_mode', 'processing', 'payone_misc');
return $this->request->getClientIp($blProxyMode);
$sClientIp = $this->request->getClientIp($blProxyMode); // may return a comma separated ip list like "<client>, <proxy1>, <proxy2>"
$aSplitIp = explode(",", $sClientIp); // split by comma
return trim(current($aSplitIp)); // return first array element
}

/**
Expand Down

0 comments on commit 8b9c6ea

Please sign in to comment.