php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #67231
Patch geoip.patch revision 2014-05-08 03:46 UTC by anthon at piwik dot org

Patch geoip.patch for geoip Bug #67231

Patch version 2014-05-08 03:46 UTC

Return to Bug #67231 | Download this patch
Patch Revisions:

Developer: anthon@piwik.org

Index: geoip.c
===================================================================
--- geoip.c	(revision 333498)
+++ geoip.c	(working copy)
@@ -549,9 +549,9 @@
 	}
 
 	if (GeoIP_db_avail(GEOIP_CITY_EDITION_REV1) || GeoIP_db_avail(GEOIP_CITY_EDITION_REV0)) {
-		if (GeoIP_db_avail(GEOIP_CITY_EDITION_REV1)) {
-			gi = GeoIP_open_type(GEOIP_CITY_EDITION_REV1, GEOIP_STANDARD);
-		} else {
+		gi = GeoIP_open_type(GEOIP_CITY_EDITION_REV1, GEOIP_STANDARD);
+
+		if (NULL == gi) {
 			gi = GeoIP_open_type(GEOIP_CITY_EDITION_REV0, GEOIP_STANDARD);
 		}
 	}   else {
@@ -629,9 +629,9 @@
 	}
 
 	if (GeoIP_db_avail(GEOIP_REGION_EDITION_REV0) || GeoIP_db_avail(GEOIP_REGION_EDITION_REV1)) {
-		if (GeoIP_db_avail(GEOIP_REGION_EDITION_REV1)) {
-			gi = GeoIP_open_type(GEOIP_REGION_EDITION_REV1, GEOIP_STANDARD);
-		} else {
+		gi = GeoIP_open_type(GEOIP_REGION_EDITION_REV1, GEOIP_STANDARD);
+
+		if (NULL == gi) {
 			gi = GeoIP_open_type(GEOIP_REGION_EDITION_REV0, GEOIP_STANDARD);
 		}
 	}   else {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 01:01:30 2024 UTC