Skip to content

Commit

Permalink
Fix: explode(): Passing null to parameter #2 ($string) of type string…
Browse files Browse the repository at this point in the history
… is deprecated
  • Loading branch information
magefan committed Feb 17, 2023
1 parent c8b6de4 commit 1a20ecc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Model/IpToCountryRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ public function getCountryCode($ip)
if (!isset($this->ipToCountry[$ip])) {
$this->ipToCountry[$ip] = false;

$simulateCountry = $this->config->getValue(self::XML_PATH_SIMULATE_COUNTRY, ScopeInterface::SCOPE_STORE);
$simulateCountry = $this->config->getValue(self::XML_PATH_SIMULATE_COUNTRY, ScopeInterface::SCOPE_STORE) ?: '';
if ($simulateCountry) {
$allowedIPs = explode(',', $this->config->getValue(self::XML_PATH_ALLOW_IPS, ScopeInterface::SCOPE_STORE));
$allowedIPs = explode(',', $this->config->getValue(self::XML_PATH_ALLOW_IPS, ScopeInterface::SCOPE_STORE) ?: '');
foreach ($allowedIPs as $allowedIp) {
$allowedIp = trim($allowedIp);
if ($allowedIp && $allowedIp == $ip) {
Expand Down

0 comments on commit 1a20ecc

Please sign in to comment.