]> git.openstreetmap.org Git - nominatim.git/commitdiff
if nameaddress_vector was {} the database queries failed
authormarc tobias <mtmail@gmx.net>
Tue, 26 Mar 2019 16:59:27 +0000 (17:59 +0100)
committermarc tobias <mtmail@gmx.net>
Tue, 26 Mar 2019 17:03:26 +0000 (18:03 +0100)
website/details.php

index b9818bbf74ba3bae640d46f84713c4d2c17b4049..cb371e6b09d2cd8d3e21d463731dce8dea552820 100644 (file)
@@ -220,11 +220,17 @@ if ($bIncludeKeywords) {
     $aPlaceSearchName = $oDB->getRow($sSQL);
 
     if (!empty($aPlaceSearchName)) {
     $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);
+        }
     }
 }
 
     }
 }