We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef01012 commit a326ad4Copy full SHA for a326ad4
Model/IpToCountryRepository.php
@@ -55,8 +55,8 @@ public function getCountryCode($ip)
55
if (!$this->ipToCountry[$ip]) {
56
$longIp = ip2long($ip);
57
$collection = $this->ipToCountryCollectionFactory->create();
58
- $collection->addFieldToFilter('ip_from', ["gteq" => $longIp])
59
- ->addFieldToFilter('ip_to', ["lteq" => $longIp])
+ $collection->addFieldToFilter('ip_from', ["lteq" => $longIp])
+ ->addFieldToFilter('ip_to', ["gteq" => $longIp])
60
->setPageSize(1);
61
$ipInfo = $collection->getFirstItem();
62
$this->ipToCountry[$ip] = $ipInfo->getCountryCode() ?: false;
0 commit comments