From 5374b839ce6873299a369b259597abe5d4f673b3 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Sun, 24 Apr 2011 11:07:12 +0100 Subject: [PATCH] Change bool search matching to raise an exception for invalid queries --- src/calibre/library/caches.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index e4342988b8..ca256e0350 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -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: