From 7175ba74c5a4ae432c40488c30a844516659226e Mon Sep 17 00:00:00 2001 From: Chase Davies <1214246+chasepd@users.noreply.github.com> Date: Tue, 27 Aug 2024 14:07:39 -0600 Subject: [PATCH] Update views.py --- webapp/ui/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/ui/views.py b/webapp/ui/views.py index 8fe9616..8a236ae 100644 --- a/webapp/ui/views.py +++ b/webapp/ui/views.py @@ -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)