summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-10-24 12:05:19 +0100
committerGitHub <noreply@github.com>2018-10-24 12:05:19 +0100
commit78e8d4c3a5e44649f70f6f45b47eb849ae3b9efe (patch)
tree741c28822a3b5e26d229be68bc06c95a25218748 /synapse
parentMerge pull request #4082 from matrix-org/rav/fix_pep8 (diff)
parentMerge remote-tracking branch 'origin/develop' into rav/fix_event_filter_valid... (diff)
downloadsynapse-78e8d4c3a5e44649f70f6f45b47eb849ae3b9efe.tar.xz
Merge pull request #4083 from matrix-org/rav/fix_event_filter_validation
Allow backslashes in event field filters
Diffstat (limited to 'synapse')
-rw-r--r--synapse/api/filtering.py5
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"^((?!\\\\).)*$" } } },