mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-24 21:54:03 +02:00
Detect invalid boolean searches
This commit is contained in:
commit
6f255e0d11
1 changed files with 4 additions and 0 deletions
|
|
@ -560,6 +560,10 @@ def get_bool_matches(self, location, query, candidates):
|
|||
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…
Reference in a new issue