Commit:    0344cc1f94162bc76c85be8def22224e9ffb9d10
Author:    Hannes Magnusson <[email protected]>         Tue, 3 Dec 2013 
22:42:12 -0800
Parents:   a96814d7363e04b480853a89c9a929d46fe07903
Branches:  master

Link:       
http://git.php.net/?p=web/php.git;a=commitdiff;h=0344cc1f94162bc76c85be8def22224e9ffb9d10

Log:
Fix a warning with the new example files

Changed paths:
  M  include/ip-to-country.inc


Diff:
diff --git a/include/ip-to-country.inc b/include/ip-to-country.inc
index e45d404..86f8074 100644
--- a/include/ip-to-country.inc
+++ b/include/ip-to-country.inc
@@ -98,6 +98,10 @@ function i2c_search_in_index($ip)
     // Read in granularity from index file and
     // convert current IP to something useful
     $granularity = intval(fgets($dbidx, 64));
+    if (!$granularity) {
+        // The file is empty (demo file)
+        return false;
+    }
     $ip_chunk = intval($ip / $granularity);
 
     // Loop till we can read the file


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to