Check if the country-region combination exists.
Check that a given country and region combination for an IP exists in $crnMap. Fix issue reported by @xifrin in https://github.com/dlage/yii-geoip/pull/2
This commit is contained in:
@@ -4513,7 +4513,7 @@ class GeoIP_CRN {
|
||||
* @return string Metro region name.
|
||||
*/
|
||||
public static function getRegionName($countryCode, $regionCode) {
|
||||
if ($countryCode === null || $regionCode === null) {
|
||||
if ($countryCode === null || $regionCode === null || !isset(self::$crnMap[$countryCode][$regionCode])) {
|
||||
return null;
|
||||
}
|
||||
return self::$crnMap[$countryCode][$regionCode];
|
||||
|
||||
Reference in New Issue
Block a user