svn: /web/php-master/trunk/scripts/ ip-to-country
| From: | Hannes Magnusson | Date: | Wed, 17 Aug 2011 14:40:02 +0000 |
| Subject: | svn: /web/php-master/trunk/scripts/ ip-to-country | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-11941@lists.php.net to get a copy of this message | ||
bjori Wed, 17 Aug 2011 14:40:02 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=315072
Log:
Workaround for broken data from the api, the last result is missing an new line before the ending
token
Changed paths:
U web/php-master/trunk/scripts/ip-to-country
Modified: web/php-master/trunk/scripts/ip-to-country
===================================================================
--- web/php-master/trunk/scripts/ip-to-country 2011-08-17 14:28:24 UTC (rev 315071)
+++ web/php-master/trunk/scripts/ip-to-country 2011-08-17 14:40:02 UTC (rev 315072)
@@ -71,6 +71,9 @@
if (trim($line) == "#Directi IP-to-Country Db: End") {
$state = 'lastline';
} elseif (!preg_match("!\\d{20}\\w{3}\n!", $line)) {
+ /* pretend it was the last line, seems to be a temp failure in the data */
+ $state = "lastline";
+ break;
$fileok = FALSE;
break 2;
} else {