svn: /web/php/trunk/include/ ip-to-country.inc
| From: | Sean Coates | Date: | Sat, 31 Oct 2009 18:18:06 +0000 |
| Subject: | svn: /web/php/trunk/include/ ip-to-country.inc | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-6305@lists.php.net to get a copy of this message | ||
sean Sat, 31 Oct 2009 18:18:06 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=290110
Log:
check for ip-to-country index before opening it, to be safe
Changed paths:
U web/php/trunk/include/ip-to-country.inc
Modified: web/php/trunk/include/ip-to-country.inc
===================================================================
--- web/php/trunk/include/ip-to-country.inc 2009-10-31 18:12:22 UTC (rev 290109)
+++ web/php/trunk/include/ip-to-country.inc 2009-10-31 18:18:06 UTC (rev 290110)
@@ -89,8 +89,9 @@
$idxpart = 0; $recnum = 0;
// Open the index file for reading
- $dbidx = fopen(
- $_SERVER['DOCUMENT_ROOT'] . "/backend/ip-to-country.idx",
+ $idxfilename = $_SERVER['DOCUMENT_ROOT'] . "/backend/ip-to-country.idx";
+ $dbidx = is_readable($idxfilename) && fopen(
+ $idxfilename,
"r"
);
if (!$dbidx) { return FALSE; }