X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/8fd7d319b7ef6ee4d4f8cf3b61eb47903e7fb1eb..b42939a3249e73027516eb6e79a9f1f8c642ff95:/website/reverse.php diff --git a/website/reverse.php b/website/reverse.php index ee6a6100..d70a11e9 100755 --- a/website/reverse.php +++ b/website/reverse.php @@ -6,18 +6,6 @@ require_once(CONST_BasePath.'/lib/PlaceLookup.php'); require_once(CONST_BasePath.'/lib/ReverseGeocode.php'); - if (strpos(CONST_BulkUserIPs, ','.$_SERVER["REMOTE_ADDR"].',') !== false) - { - $fLoadAvg = getLoadAverage(); - if ($fLoadAvg > 2) sleep(60); - if ($fLoadAvg > 4) sleep(120); - if ($fLoadAvg > 6) - { - echo "Bulk User: Temporary block due to high server load\n"; - exit; - } - } - $oDB =& getDB(); ini_set('memory_limit', '200M'); @@ -45,10 +33,8 @@ $oPlaceLookup->setOSMID($_GET['osm_type'], $_GET['osm_id']); $aPlace = $oPlaceLookup->lookup(); - - //if (!$iPlaceID) $sError = 'OSM ID Not Found'; } - else + else if (isset($_GET['lat']) && isset($_GET['lon']) && preg_match('/^[+-]?[0-9]*\.?[0-9]+$/', $_GET['lat']) && preg_match('/^[+-]?[0-9]*\.?[0-9]+$/', $_GET['lon'])) { $oReverseGeocode = new ReverseGeocode($oDB); $oReverseGeocode->setLanguagePreference($aLangPrefOrder); @@ -59,6 +45,12 @@ $aPlace = $oReverseGeocode->lookup(); } + else + { + $aPlace = null; + } + + logEnd($oDB, $hLog, sizeof($aPlace)?1:0); if (CONST_Debug) exit;