$sLanguagePrefArraySQL = $oDB->getArraySQL($oDB->getDBQuotedList($aLangPrefOrder));
+if ($sOutputFormat == 'html' && !$sPlaceId && !$sOsmType) {
+ include(CONST_BasePath.'/lib/template/details-index-html.php');
+ exit;
+}
+
if ($sOsmType && $iOsmId > 0) {
$sSQL = 'SELECT place_id FROM placex WHERE osm_type = :type AND osm_id = :id';
// osm_type and osm_id are not unique enough
$aPlaceSearchName = $oDB->getRow($sSQL);
if (!empty($aPlaceSearchName)) {
- $sSQL = 'SELECT * FROM word WHERE word_id in ('.substr($aPlaceSearchName['name_vector'], 1, -1).')';
- $aPlaceSearchNameKeywords = $oDB->getAll($sSQL);
+ $sWordIds = substr($aPlaceSearchName['name_vector'], 1, -1);
+ if (!empty($sWordIds)) {
+ $sSQL = 'SELECT * FROM word WHERE word_id in ('.$sWordIds.')';
+ $aPlaceSearchNameKeywords = $oDB->getAll($sSQL);
+ }
- $sSQL = 'SELECT * FROM word WHERE word_id in ('.substr($aPlaceSearchName['nameaddress_vector'], 1, -1).')';
- $aPlaceSearchAddressKeywords = $oDB->getAll($sSQL);
+ $sWordIds = substr($aPlaceSearchName['nameaddress_vector'], 1, -1);
+ if (!empty($sWordIds)) {
+ $sSQL = 'SELECT * FROM word WHERE word_id in ('.$sWordIds.')';
+ $aPlaceSearchAddressKeywords = $oDB->getAll($sSQL);
+ }
}
}