1
0
Fork 0
mirror of https://github.com/Findus23/plugin-ExcludeCountries.git synced 2024-09-19 15:53:47 +02:00

don't do anything if no country is detected

see #2
This commit is contained in:
Lukas Winkler 2020-09-04 13:17:28 +02:00
parent fe90e98eb4
commit 865b72a383
Signed by: lukas
GPG key ID: 54DE4D798D244853
2 changed files with 5 additions and 2 deletions

View file

@ -45,7 +45,10 @@ class ExcludeCountries extends Plugin
$location = $provider->getLocation(["ip" => $request->getIp()]); $location = $provider->getLocation(["ip" => $request->getIp()]);
$countryCode = strtolower($location[LocationProvider::COUNTRY_CODE_KEY]); $countryCode = strtolower($location[LocationProvider::COUNTRY_CODE_KEY]);
if (!$location || empty($countryCode)) {
$logger->debug("ExcludeCountries could not detect a location");
return;
}
$excludeBool = $settings->excludeBool->getValue(); $excludeBool = $settings->excludeBool->getValue();
if ($excludeBool) { if ($excludeBool) {

View file

@ -1,7 +1,7 @@
{ {
"name": "ExcludeCountries", "name": "ExcludeCountries",
"description": "Exclude or include visitors from selected countries", "description": "Exclude or include visitors from selected countries",
"version": "0.1.3", "version": "0.1.4",
"theme": false, "theme": false,
"require": { "require": {
"piwik": ">=3.10.0,<4.0.0-b1" "piwik": ">=3.10.0,<4.0.0-b1"