X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/2ab9e4acd3a2ceb5ff871b6b6afc786377e8739f..8c3a0efe8b75a06279998e66a932d8a56c483961:/website/details.php diff --git a/website/details.php b/website/details.php index 39fa0afa..6f7c807d 100644 --- a/website/details.php +++ b/website/details.php @@ -37,12 +37,14 @@ if ($sOutputFormat == 'html' && !$sPlaceId && !$sOsmType) { 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 if ($sClass) { - $sSQL .= " AND class='".$sClass."'"; + $sSQL .= ' AND class= :class'; + $aSQLParams[':class'] = $sClass; } $sSQL .= ' ORDER BY class ASC'; - $sPlaceId = $oDB->getOne($sSQL, array(':type' => $sOsmType, ':id' => $iOsmId)); + $sPlaceId = $oDB->getOne($sSQL, $aSQLParams); // Nothing? Maybe it's an interpolation.