diff --git a/src/geoip.inc b/src/geoip.inc index 62a4e78..378647f 100644 --- a/src/geoip.inc +++ b/src/geoip.inc @@ -1844,11 +1844,12 @@ function _get_region($gi, $ipnum) $country_code = "CA"; $region = chr(($seek_region - CANADA_OFFSET) / 26 + 65) . chr(($seek_region - CANADA_OFFSET) % 26 + 65); } else { - $country_code = $gi->GEOIP_COUNTRY_CODES[($seek_region - WORLD_OFFSET) / FIPS_RANGE]; + $country_code = $gi->GEOIP_COUNTRY_CODES[(int) (($seek_region - WORLD_OFFSET) / FIPS_RANGE)]; $region = ""; } return array($country_code, $region); } + return null; } function geoip_region_by_addr($gi, $addr) diff --git a/src/geoipcity.inc b/src/geoipcity.inc index c6511da..88ced72 100644 --- a/src/geoipcity.inc +++ b/src/geoipcity.inc @@ -112,7 +112,7 @@ function _common_get_record($gi, $seek_country) $record->postal_code = substr($record_buf, $record_buf_pos, $str_length); } $record_buf_pos += $str_length + 1; - $str_length = 0; + // Get latitude and longitude $latitude = 0; $longitude = 0; diff --git a/timezone/make_time_zone_php_code.pl b/timezone/make_time_zone_php_code.pl index d4cc5f4..0b92934 100755 --- a/timezone/make_time_zone_php_code.pl +++ b/timezone/make_time_zone_php_code.pl @@ -21,7 +21,7 @@ * Get time zone * @param string $country * @param string $region - * @return string If the timezone is not found, returns NULL + * @return string If the timezone is not found, returns null` */ function get_time_zone($country, $region) {