Skip to content

Commit

Permalink
Merge pull request #18 from someline/1.5
Browse files Browse the repository at this point in the history
Improved ip to country
  • Loading branch information
libern authored Jun 8, 2017
2 parents 1889872 + cbcfb99 commit 9bcfafe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Someline/Foundation/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ function ip_to_country_iso_code($ip = null, $default_iso_code = 'US')
$location = \GeoIP::getLocation($ip);

// check if NOT returned default
if ($location['default'] === false && !empty($location['isoCode'])) {
if ($location['default'] === false && !empty($location['iso_code'])) {
return $location['iso_code'];
} else if ($location['default'] === false && !empty($location['isoCode'])) {
return $location['isoCode'];
} else {
return $default_iso_code;
Expand Down

0 comments on commit 9bcfafe

Please sign in to comment.