]> git.openstreetmap.org Git - nominatim.git/commitdiff
Allow negative osm_id in details page by setting default parameter to 0
authoralfmarcua <alfmarcua@gmail.com>
Fri, 11 Aug 2023 08:46:28 +0000 (10:46 +0200)
committeralfmarcua <alfmarcua@gmail.com>
Fri, 11 Aug 2023 08:46:28 +0000 (10:46 +0200)
lib-php/website/details.php

index 99307bbd9fb229a09e01b278872839f6b7512198..98fb6ef75fdaf9fb6799b0d97c97028544c9395a 100644 (file)
@@ -23,7 +23,7 @@ $aLangPrefOrder = $oParams->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);
@@ -38,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