Skip to content

Commit

Permalink
Update views.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chasepd authored Aug 27, 2024
1 parent c04dc21 commit 7175ba7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webapp/ui/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ def prepare_source_line(query_re, srcline, html=True):
def get_query_re(query, case_sensitive=True):
try:
if case_sensitive:
return re.compile(r'(' + query + r')')
return re.compile(r'(' + re.escape(query) + r')')
else:
return re.compile(r'(' + query + r')', flags=re.IGNORECASE)
return re.compile(r'(' + re.escape(query) + r')', flags=re.IGNORECASE)
except Exception as e:
raise RegexError(e)

Expand Down

0 comments on commit 7175ba7

Please sign in to comment.