cvs: phpweb /include ip-to-country.inc
| From: | Gabor Hojtsy | Date: | Mon, 26 May 2003 18:44:19 +0000 |
| Subject: | cvs: phpweb /include ip-to-country.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-18119@lists.php.net to get a copy of this message | ||
goba Mon May 26 14:44:19 2003 EDT
Modified files:
/phpweb/include ip-to-country.inc
Log:
This search in the index was causing most of the IPs
to be hidden in the db since I have added the speed
increase fix. The previous ranges were checked for IPs
instead of the actual range where the IP was [because ==
was true for the upper part of the region].
Now we search in one region up, and that makes this
whole code work again without any more resource needs.
Plus it also finds Rasmus' home IP finally ;))
Index: phpweb/include/ip-to-country.inc
diff -u phpweb/include/ip-to-country.inc:1.16 phpweb/include/ip-to-country.inc:1.17
--- phpweb/include/ip-to-country.inc:1.16 Sun May 25 08:39:26 2003
+++ phpweb/include/ip-to-country.inc Mon May 26 14:44:19 2003
@@ -1,6 +1,6 @@
<?php // -*- C++ -*-
-// $Id: ip-to-country.inc,v 1.16 2003/05/25 12:39:26 goba Exp $
+// $Id: ip-to-country.inc,v 1.17 2003/05/26 18:44:19 goba Exp $
/*
@@ -109,7 +109,7 @@
$data = fgetcsv($dbidx, 100);
// Compare current index part with our IP
- if ($ip_chunk >= $idxpart && $ip_chunk <= (int) $data[0]) {
+ if ($ip_chunk >= $idxpart && $ip_chunk < (int) $data[0]) {
return array($recnum, (int) $data[1]);
}