mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Detect invalid boolean searches
This commit is contained in:
commit
6f255e0d11
@ -560,6 +560,10 @@ class ResultCache(SearchQueryParser): # {{{
|
||||
loc = self.field_metadata[location]['rec_index']
|
||||
matches = set()
|
||||
query = icu_lower(query)
|
||||
if query not in (_('no'), _('unchecked'), '_no', 'false',
|
||||
_('yes'), _('checked'), '_yes', 'true',
|
||||
_('empty'), _('blank'), '_empty'):
|
||||
raise ParseException(_('Invalid boolean query "{0}"').format(query))
|
||||
for id_ in candidates:
|
||||
item = self._data[id_]
|
||||
if item is None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user