From d1552b0904189879432224693b8cd2d4a86ab4c5 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 26 Jan 2015 21:59:36 +0100 Subject: [PATCH] don't use tokens from country parameter in address field of searches fixes #218 --- lib/Geocode.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Geocode.php b/lib/Geocode.php index d96b6cb8..11e47d9a 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -611,7 +611,10 @@ } } } - if (isset($aValidTokens[$sToken])) + // Look for partial matches. + // Note that there is no point in adding country terms here + // because country are omitted in the address. + if (isset($aValidTokens[$sToken]) && $sPhraseType != 'country') { // Allow searching for a word - but at extra cost foreach($aValidTokens[$sToken] as $aSearchTerm)