mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
Change bool search matching to raise an exception for invalid queries
This commit is contained in:
parent
14666b417c
commit
5374b839ce
@ -560,6 +560,10 @@ class ResultCache(SearchQueryParser): # {{{
|
|||||||
loc = self.field_metadata[location]['rec_index']
|
loc = self.field_metadata[location]['rec_index']
|
||||||
matches = set()
|
matches = set()
|
||||||
query = icu_lower(query)
|
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:
|
for id_ in candidates:
|
||||||
item = self._data[id_]
|
item = self._data[id_]
|
||||||
if item is None:
|
if item is None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user