diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-10-24 10:41:45 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-10-24 11:11:24 +0100 |
commit | 7e07d25ed64e6af403dd508a2b5226e8d18fc1ac (patch) | |
tree | 0d62393e2f7ede6ea79fcedf793fbc20de39e3d8 /synapse | |
parent | Merge pull request #4075 from matrix-org/rav/fix_pusher_logcontexts (diff) | |
download | synapse-7e07d25ed64e6af403dd508a2b5226e8d18fc1ac.tar.xz |
Allow backslashes in event field filters
Fixes a bug introduced in https://github.com/matrix-org/synapse/pull/1783 which meant that single backslashes were not allowed in event field filters. The intention here is to allow single-backslashes, but disallow double-backslashes.
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/api/filtering.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/api/filtering.py b/synapse/api/filtering.py index eed8c67e6a..677c0bdd4c 100644 --- a/synapse/api/filtering.py +++ b/synapse/api/filtering.py @@ -172,7 +172,10 @@ USER_FILTER_SCHEMA = { # events a lot easier as we can then use a negative lookbehind # assertion to split '\.' If we allowed \\ then it would # incorrectly split '\\.' See synapse.events.utils.serialize_event - "pattern": "^((?!\\\).)*$" + # + # Note that because this is a regular expression, we have to escape + # each backslash in the pattern. + "pattern": r"^((?!\\\\).)*$" } } }, |