Also escape backslashes in search terms

So that our users can’t accidentally escape characters themselves.
This commit is contained in:
Chris Hill-Scott
2018-03-14 11:29:19 +00:00
parent bdd77f9150
commit 9103ca5975
2 changed files with 6 additions and 3 deletions

View File

@@ -1779,9 +1779,11 @@ def test_dao_get_notifications_by_to_field_matches_partial_emails(sample_email_t
('%', 2),
('_', 1),
('/', 1),
('\\', 1),
('baz\\baz', 1),
('%foo', 0),
('%_%', 0),
('example.com', 4),
('example.com', 5),
])
def test_dao_get_notifications_by_to_field_escapes(
sample_email_template,
@@ -1794,6 +1796,7 @@ def test_dao_get_notifications_by_to_field_escapes(
'%%bar@example.com',
'foobar@example.com',
'/@example.com',
'baz\\baz@example.com',
}:
create_notification(
template=sample_email_template,