diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-12-15 02:20:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-15 02:20:27 +0300 |
commit | a3701ab34c829b67d00af4fbddecf11539838a1f (patch) | |
tree | 8231ba21322b6cb5fdcebcfe6b23ce0ec9a8b341 /plugins/GeoIp2 | |
parent | 9bf10dc5a659152704aea7ec532197a12ef6a194 (diff) |
Improves Geolocation diagnostics (#16780)
Diffstat (limited to 'plugins/GeoIp2')
-rw-r--r-- | plugins/GeoIp2/LocationProvider/GeoIp2.php | 2 | ||||
-rw-r--r-- | plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/plugins/GeoIp2/LocationProvider/GeoIp2.php b/plugins/GeoIp2/LocationProvider/GeoIp2.php index 3a5198aeef..61be18164a 100644 --- a/plugins/GeoIp2/LocationProvider/GeoIp2.php +++ b/plugins/GeoIp2/LocationProvider/GeoIp2.php @@ -66,7 +66,7 @@ abstract class GeoIp2 extends LocationProvider // get location using test IP and check that some information was returned $location = $this->getLocation(array('ip' => $testIp)); - $location = array_filter($location); + $location = $location ? array_filter($location) : $location; $isResultCorrect = !empty($location); if (!$isResultCorrect) { diff --git a/plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php b/plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php index f1baf19552..cc2c7c168a 100644 --- a/plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php +++ b/plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php @@ -347,4 +347,14 @@ class ServerModule extends GeoIp2 return $settingValues; } + + public function getUsageWarning(): ?string + { + $comment = Piwik::translate('GeoIp2_GeoIPLocationProviderNotRecommended') . ' '; + $comment .= Piwik::translate('GeoIp2_LocationProviderDesc_ServerModule2', array( + '<a href="https://matomo.org/docs/geo-locate/" rel="noreferrer noopener" target="_blank">', '', '', '</a>' + )); + + return $comment; + } } |