]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/lookup.php
Merge remote-tracking branch 'upstream/master' into cmake-port
[nominatim.git] / website / lookup.php
index 60bd60ebd156f2cacf1b252628d4afb9fa1765a2..5fc6c309ad2b955ddfc3dadf0a0bc286a0e35376 100755 (executable)
@@ -5,18 +5,7 @@
        require_once(CONST_BasePath.'/lib/init-website.php');
        require_once(CONST_BasePath.'/lib/log.php');
        require_once(CONST_BasePath.'/lib/PlaceLookup.php');
-
-       if (strpos(CONST_BulkUserIPs, ','.$_SERVER["REMOTE_ADDR"].',') !== false)
-       {
-               $fLoadAvg = getLoadAverage();
-               if ($fLoadAvg > 2) sleep(60);
-               if ($fLoadAvg > 4) sleep(120);
-               if ($fLoadAvg > 6)
-               {
-                       userError("Bulk User: Temporary block due to high server load");
-                       exit;
-               }
-       }
+       require_once(CONST_BasePath.'/lib/output.php');
 
        $oDB =& getDB();
        ini_set('memory_limit', '200M');
@@ -38,7 +27,7 @@
        $oPlaceLookup->setIncludeExtraTags(getParamBool('extratags', false));
        $oPlaceLookup->setIncludeNameDetails(getParamBool('namedetails', false));
 
-       $aOsmIds = explode(',', $getParamString('osm_ids', ''));
+       $aOsmIds = explode(',', getParamString('osm_ids', ''));
 
        if (count($aOsmIds) > CONST_Places_Max_ID_count)
        {
@@ -55,8 +44,7 @@
                if ( $iId > 0 && ($sType == 'N' || $sType == 'W' || $sType == 'R') )
                {
                        $aCleanedQueryParts[] = $sType . $iId;
-                       $oPlaceLookup->setOSMID($sType, $iId);
-                       $oPlace = $oPlaceLookup->lookup();
+                       $oPlace = $oPlaceLookup->lookupOSMID($sType, $iId);
                        if ($oPlace){
                                // we want to use the search-* output templates, so we need to fill
                                // $aSearchResults and slightly change the (reverse search) oPlace