escape + in deck names

This commit is contained in:
Damien Elmes 2013-07-18 18:44:40 +09:00
parent 6f66f11572
commit 26a3c30365

View file

@ -365,7 +365,9 @@ select distinct(n.id) from cards c, notes n where c.nid=n.id and """+preds
else:
# wildcard
ids = set()
# should use re.escape in the future
val = val.replace("*", ".*")
val = val.replace("+", "\\+")
for d in self.col.decks.all():
if re.match("(?i)"+val, d['name']):
ids.update(dids(d['id']))