From: marc tobias Date: Tue, 26 Mar 2019 16:59:27 +0000 (+0100) Subject: if nameaddress_vector was {} the database queries failed X-Git-Tag: v3.3.0~18 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/850ab6999cb12520e1f00b39bf7803d6c47b3705 if nameaddress_vector was {} the database queries failed --- diff --git a/website/details.php b/website/details.php index b9818bbf..cb371e6b 100644 --- a/website/details.php +++ b/website/details.php @@ -220,11 +220,17 @@ if ($bIncludeKeywords) { $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); + } } }