Skip to content

Commit

Permalink
Merge pull request #1 from Techjar/fix-filter-string
Browse files Browse the repository at this point in the history
api: Escape value in _filter_string regex
  • Loading branch information
spycrab authored Apr 8, 2019
2 parents a78435b + 3d1148f commit 895d326
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 895d326

Please sign in to comment.