File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 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)
5454 throw new NoResult (sprintf ('Could not find "%s" IP address in database. ' , $ address ));
5555 }
5656
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+ }
5964
6065 return $ this ->returnResults ([
6166 $ this ->fixEncoding (array_merge ($ this ->getDefaults (), [
You can’t perform that action at this time.
0 commit comments