php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55203 Missing region names from geoip library
Submitted: 2011-07-14 00:00 UTC Modified: 2011-07-14 03:35 UTC
From: serge dot rivest at gmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.3SVN-2011-07-14 (SVN) OS: Linux (Ubuntu)
Private report: No CVE-ID: None
 [2011-07-14 00:00 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-14 03:35 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2011-07-14 03:35 UTC] pajoye@php.net
Please report bugs at pecl.php.net/geoip

btw, I suppose your DB is not updated.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 19:01:32 2024 UTC