X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/27af9b102c2d6167b9025d594f8cb75e4dd76a03..a66c063314a2370ceb877513edbf0d0b683626fd:/lib-php/website/details.php diff --git a/lib-php/website/details.php b/lib-php/website/details.php index c16725e2..98fb6ef7 100644 --- a/lib-php/website/details.php +++ b/lib-php/website/details.php @@ -1,4 +1,12 @@ getPreferredLanguages(); $sPlaceId = $oParams->getString('place_id'); $sOsmType = $oParams->getSet('osmtype', array('N', 'W', 'R')); -$iOsmId = $oParams->getInt('osmid', -1); +$iOsmId = $oParams->getInt('osmid', 0); $sClass = $oParams->getString('class'); $bIncludeKeywords = $oParams->getBool('keywords', false); @@ -30,7 +38,7 @@ $oDB->connect(); $sLanguagePrefArraySQL = $oDB->getArraySQL($oDB->getDBQuotedList($aLangPrefOrder)); -if ($sOsmType && $iOsmId > 0) { +if ($sOsmType && $iOsmId !== 0) { $sSQL = 'SELECT place_id FROM placex WHERE osm_type = :type AND osm_id = :id'; $aSQLParams = array(':type' => $sOsmType, ':id' => $iOsmId); // osm_type and osm_id are not unique enough @@ -83,7 +91,7 @@ if ($sOsmType && $iOsmId > 0) { } if ($sPlaceId === false) { - throw new Exception('No place with that OSM ID found.', 404); + throw new \Exception('No place with that OSM ID found.', 404); } } else { if ($sPlaceId === false) { @@ -146,7 +154,7 @@ $sSQL .= " WHERE place_id = $iPlaceID"; $aPointDetails = $oDB->getRow($sSQL, null, 'Could not get details of place object.'); if (!$aPointDetails) { - throw new Exception('No place with that place ID found.', 404); + throw new \Exception('No place with that place ID found.', 404); } $aPointDetails['localname'] = $aPointDetails['localname']?$aPointDetails['localname']:$aPointDetails['housenumber']; @@ -198,7 +206,7 @@ if ($bIncludeLinkedPlaces) { $aLinkedLines = $oDB->getAll($sSQL); } -// All places this is an imediate parent of +// All places this is an immediate parent of $aHierarchyLines = false; if ($bIncludeHierarchy) { $sSQL = 'SELECT obj.place_id, osm_type, osm_id, class, type, housenumber,';