Edit report at https://bugs.php.net/bug.php?id=55203&edit=1

 ID:                 55203
 Updated by:         paj...@php.net
 Reported by:        serge dot rivest at gmail dot com
 Summary:            Missing region names from geoip library
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            Unknown/Other Function
 Operating System:   Linux (Ubuntu)
 PHP Version:        5.3SVN-2011-07-14 (SVN)
 Block user comment: N
 Private report:     N

 New Comment:

Please report bugs at pecl.php.net/geoip

btw, I suppose your DB is not updated.


Previous Comments:
------------------------------------------------------------------------
[2011-07-14 00:00:33] serge dot rivest at gmail dot com

Description:
------------
PHP Version: PHP 5.3.3-1ubuntu9.3 with Suhosin-Patch (cli) (built: Jan 12 2011 
16:07:38) 
GeoIP version: GEO-106 20110510 Build 1 Copyright (c) 2011 MaxMind Inc All 
Rights Reserved

Description:
Upon calling geoip_region_name_by_code for certain regions, the region name 
returned is empty.

Ex: 
echo geoip_region_name_by_code("AG","08"); // Returns: Saint Philip
echo geoip_region_name_by_code("AG","09"); // Returns: Nothing

What is expected:
The geoip_region_name_by_code function to return the correct region name for 
all 
regions described in the standard http://www.maxmind.com/app/fips10_4
(Note: This link is even published on 
http://www.php.net/manual/en/function.geoip-region-name-by-code.php)

The issue:
As mentioned on http://www.php.net/manual/en/function.geoip-region-name-by-
code.php

The data is taken directly from the GeoIP Library and not from any database.

This means that the php geoip library has to be updated.

Solution:
Small mindless work of updating the source code of the php geoip library with 
the missing regions. (44 of them):

Country         Region
AG              09
CG              13
CG              14
HU              43
MD              57
MV              30
MV              31
MV              32
MV              33
MV              34
MV              35
MV              36
MV              37
MV              38
MV              39
MV              41
MV              42
MV              43
MV              44
MV              45
MV              46
MV              47
TN              10
UG              26
UG              28
UG              29
UG              30
UG              31
UG              38
UG              39
UG              40
UG              41
UG              43
UG              45
UG              46
UG              47
UG              50
UG              58
UG              59
UG              60
UG              61
UG              70
UG              72
UG              76


Test script:
---------------
echo geoip_region_name_by_code("AG","08");
Saint Philip // Working!

echo geoip_region_name_by_code("AG","09");
// Nothing ...

Expected result:
----------------
The region name according to http://www.maxmind.com/app/fips10_4



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55203&edit=1

Reply via email to