Compare commits

1 Commits

Author SHA1 Message Date
1294311278 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
2013-10-28 13:23:01 +00:00

View File

@@ -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];