Skip to content

Commit 40f7ae9

Browse files
committed
11077-GeoIP-Extension-Error
1 parent 2c41f9d commit 40f7ae9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Model/IpToCountryRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ public function __construct(
9191
*/
9292
public function getCountryCode($ip)
9393
{
94-
if ((string)$ip && !isset($ip)) {
94+
$ip = (string)$ip;
95+
if (!$ip) {
9596
return false;
9697
}
9798

Model/IpToRegionRepository.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,12 @@ public function __construct(
8181
*/
8282
public function getRegionCode($ip)
8383
{
84-
if ((string)$ip && !isset($ip)) {
84+
$ip = (string)$ip;
85+
if (!$ip) {
8586
return '';
8687
}
8788

88-
if (!isset($this->ipToRegion[$ip])) {
89+
if (!isset($this->ipToRegion[$ip])) {
8990
$this->ipToRegion[$ip] = '';
9091

9192
try {

0 commit comments

Comments
 (0)