diff options
author | diosmosis <benaka@piwik.pro> | 2015-07-16 22:54:42 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-07-16 22:54:42 +0300 |
commit | cd5b74fb03b072e2448938e0a229fb836d5110d7 (patch) | |
tree | f161d9aec92db980e3eee83800923613788f7443 /plugins/UserCountry | |
parent | 662da46454078fdccb99d344d7e201f9f3d4254d (diff) |
Refs #8230, make sure users of Location::getProviderById do not check if the result is false, but is empty.
Diffstat (limited to 'plugins/UserCountry')
-rw-r--r-- | plugins/UserCountry/Controller.php | 4 | ||||
-rwxr-xr-x | plugins/UserCountry/LocationProvider.php | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/plugins/UserCountry/Controller.php b/plugins/UserCountry/Controller.php index d5afd0e1b9..a241968cbd 100644 --- a/plugins/UserCountry/Controller.php +++ b/plugins/UserCountry/Controller.php @@ -314,8 +314,8 @@ class Controller extends \Piwik\Plugin\ControllerAdmin public function getLocationUsingProvider() { $providerId = Common::getRequestVar('id'); - $provider = $provider = LocationProvider::getProviderById($providerId); - if ($provider === false) { + $provider = LocationProvider::getProviderById($providerId); + if (empty($provider)) { throw new Exception("Invalid provider ID: '$providerId'."); } diff --git a/plugins/UserCountry/LocationProvider.php b/plugins/UserCountry/LocationProvider.php index f12a2126d5..50fd52b987 100755 --- a/plugins/UserCountry/LocationProvider.php +++ b/plugins/UserCountry/LocationProvider.php @@ -294,7 +294,7 @@ abstract class LocationProvider public static function setCurrentProvider($providerId) { $provider = self::getProviderById($providerId); - if ($provider === false) { + if (empty($provider)) { throw new Exception( "Invalid provider ID '$providerId'. The provider either does not exist or is not available"); } |