Skip to content

Commit

Permalink
Updated explode
Browse files Browse the repository at this point in the history
  • Loading branch information
woutse committed May 6, 2022
1 parent 82f425f commit c16abec
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,12 @@ public function isTestMode()
$ip = isset($_SERVER['HTTP_CLIENT_IP']) ? $_SERVER['HTTP_CLIENT_IP'] : $remoteIP;

$ipconfig = $this->store->getConfig('payment/paynl/testipaddress');
$allowed_ips = explode(',', $ipconfig);
if (in_array($ip, $allowed_ips) && filter_var($ip, FILTER_VALIDATE_IP) && strlen($ip) > 0 && count($allowed_ips) > 0) {
return true;

if(!empty($ipconfig)) {
$allowed_ips = explode(',', $ipconfig);
if (in_array($ip, $allowed_ips) && filter_var($ip, FILTER_VALIDATE_IP) && strlen($ip) > 0 && count($allowed_ips) > 0) {
return true;
}
}
return $this->store->getConfig('payment/paynl/testmode') == 1;
}
Expand Down

0 comments on commit c16abec

Please sign in to comment.