Skip to content

Commit

Permalink
Merge pull request #179 from jamieburchell/patch-1
Browse files Browse the repository at this point in the history
Fix preg_match search on NULL
  • Loading branch information
judgej committed Mar 8, 2022
2 parents 67226df + cc93276 commit 2925574
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Message/DirectAuthorizeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function getClientIp()
$ip = parent::getClientIp();

// OmniPay core could do with a helper for this.
if (! preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $ip)) {
if (! is_null($ip) && ! preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $ip)) {
$ip = null;
}

Expand Down

0 comments on commit 2925574

Please sign in to comment.