[GRASS-SVN] r35532 - grass-web/trunk
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jan 21 03:20:12 EST 2009
Author: neteler
Date: 2009-01-21 03:20:09 -0500 (Wed, 21 Jan 2009)
New Revision: 35532
Modified:
grass-web/trunk/index.php
Log:
trap if http://api.hostip.info/ gives 500 error
Modified: grass-web/trunk/index.php
===================================================================
--- grass-web/trunk/index.php 2009-01-21 05:04:16 UTC (rev 35531)
+++ grass-web/trunk/index.php 2009-01-21 08:20:09 UTC (rev 35532)
@@ -49,6 +49,9 @@
if (!$file_contents) {
echo "<font size=\"-1\"><i>You are at an official GRASS site (other <a href=\"mirrors.php\">mirror sites</a>)<br>";
} else {
+ if (preg_match("/Internal Server Error/i", $file_contents)) {
+ echo "<font size=\"-1\"><i>You are at an official GRASS site (other <a href=\"mirrors.php\">mirror sites</a>)<br>";
+ } else {
// e.g.: "Country: UNITED STATES (US) City: San Diego, CA"
$MYSTATETMP = explode(":", $file_contents);
$MYSTATETMP2 = explode(")", $MYSTATETMP[1]);
@@ -59,6 +62,7 @@
} else {
echo "<font size=\"-1\"><i>You are at a GRASS mirror site in $MYSTATE (other <a href=\"mirrors.php\">mirror sites</a>)<br>";
}
+ }
}
} elseif (function_exists('fopen') && allow_url_fopen ) {
$MYIP = $_SERVER['SERVER_ADDR'];
More information about the grass-commit
mailing list