Fix non-escaped '|' when searching for commas in authors using REGEXP_MATCH

This commit is contained in:
Kovid Goyal 2011-04-19 08:40:34 -06:00
commit c946c4f3d2

View File

@ -707,6 +707,9 @@ class ResultCache(SearchQueryParser): # {{{
for loc in location: # location is now an array of field indices
if loc == db_col['authors']:
### DB stores authors with commas changed to bars, so change query
if matchkind == REGEXP_MATCH:
q = query.replace(',', r'\|');
else:
q = query.replace(',', '|');
else:
q = query