Skip to content

Commit

Permalink
Merge pull request #35176 from dimagi/autofix/alert-392-488405f6f1
Browse files Browse the repository at this point in the history
Fix code scanning alert no. 392: Regular expression injection
  • Loading branch information
esoergel authored Oct 11, 2024
2 parents 2a47549 + 08c45c3 commit 2fcc2ea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions corehq/apps/sms/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,7 @@ def chat_contact_list(request, domain):
total_records = len(data)

if sSearch:
regex = re.compile('^.*%s.*$' % sSearch)
data = [row for row in data if regex.match(row[0]) or regex.match(row[2])]
data = [row for row in data if sSearch in row[0] or sSearch in row[2]]
filtered_records = len(data)

data.sort(key=lambda row: row[0])
Expand Down

0 comments on commit 2fcc2ea

Please sign in to comment.