]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/Geocode.php
fix more syntax issues
[nominatim.git] / lib / Geocode.php
index 33b02d2b1f344eba920669f6ef8d29383def0e78..2f265111ce1cd68c3c51b20169126147302c6923 100644 (file)
@@ -741,12 +741,15 @@ class Geocode
 
                         // If the token is valid
                         if (isset($aValidTokens[' '.$sToken])) {
-                            // Recheck if the original word shows up in the query.
-                            $bWordInQuery = false;
-                            if (isset($aSearchTerm['word']) && $aSearchTerm['word']) {
-                                $bWordInQuery = $this->normTerm($aSearchTerm['word']) !== false;
-                            }
                             foreach ($aValidTokens[' '.$sToken] as $aSearchTerm) {
+                                // Recheck if the original word shows up in the query.
+                                $bWordInQuery = false;
+                                if (isset($aSearchTerm['word']) && $aSearchTerm['word']) {
+                                    $bWordInQuery = strpos(
+                                        $sNormQuery,
+                                        $this->normTerm($aSearchTerm['word'])
+                                    ) !== false;
+                                }
                                 $aNewSearches = $oCurrentSearch->extendWithFullTerm(
                                     $aSearchTerm,
                                     $bWordInQuery,
@@ -1180,7 +1183,7 @@ class Geocode
                         );
                     } elseif ($oSearch->isOperator(Operator::POSTCODE)) {
                         $aPlaceIDs = $oSearch->queryPostcode(
-                            $oDB,
+                            $this->oDB,
                             $sCountryCodesSQL,
                             $this->iLimit
                         );