Skip to content

Commit

Permalink
api: Escape value in _filter_string regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Techjar committed Apr 8, 2019
1 parent a78435b commit 3d1148f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def _filter_string(sessions, key, value, match=False):

for session in sessions:
if match:
if re.match(".*" + value + ".*", str(session[key]), re.IGNORECASE):
if re.match(".*" + re.escape(value) + ".*", str(session[key]), re.IGNORECASE):
filtered_sessions.append(session)
else:
if session[key] == value:
Expand Down

0 comments on commit 3d1148f

Please sign in to comment.