In get_matches, verify that 'location' in fact exists -- is a valid search term.

This commit is contained in:
Charles Haley 2011-03-18 17:12:41 +00:00
parent 56cf0d6559
commit 85698737be

View File

@ -583,6 +583,8 @@ class ResultCache(SearchQueryParser): # {{{
candidates = self.universal_set() candidates = self.universal_set()
if len(candidates) == 0: if len(candidates) == 0:
return matches return matches
if location not in self.all_search_locations:
return matches
if len(location) > 2 and location.startswith('@') and \ if len(location) > 2 and location.startswith('@') and \
location[1:] in self.db_prefs['grouped_search_terms']: location[1:] in self.db_prefs['grouped_search_terms']: