]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/reverse.php
set SQL statement timeout to php execution timeout
[nominatim.git] / website / reverse.php
index ee6a6100c8a4da0e4c6addd6058b0c951f66ecf3..93cb58771cd3ad68df10ab6ec50798e4102bd77d 100755 (executable)
                $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);
 
                $aPlace = $oReverseGeocode->lookup();
        }
+       else
+       {
+               $aPlace = null;
+       }
 
        if (CONST_Debug) exit;