File tree 1 file changed +7
-2
lines changed 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,13 @@ public function geocode($address)
54
54
throw new NoResult (sprintf ('Could not find "%s" IP address in database. ' , $ address ));
55
55
}
56
56
57
- $ timezone = @geoip_time_zone_by_country_and_region ($ results ['country_code ' ], $ results ['region ' ]) ?: null ;
58
- $ region = @geoip_region_name_by_code ($ results ['country_code ' ], $ results ['region ' ]) ?: $ results ['region ' ];
57
+ if (!empty ($ results ['region ' ]) && !empty ($ results ['country_code ' ])) {
58
+ $ timezone = @geoip_time_zone_by_country_and_region ($ results ['country_code ' ], $ results ['region ' ]) ?: null ;
59
+ $ region = @geoip_region_name_by_code ($ results ['country_code ' ], $ results ['region ' ]) ?: $ results ['region ' ];
60
+ } else {
61
+ $ timezone = null ;
62
+ $ region = $ results ['region ' ];
63
+ }
59
64
60
65
return $ this ->returnResults ([
61
66
$ this ->fixEncoding (array_merge ($ this ->getDefaults (), [
You can’t perform that action at this time.
0 commit comments