summary refs log tree commit diff
path: root/synapse/types.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/types.py')
-rw-r--r--synapse/types.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/types.py b/synapse/types.py

index eebe29d1f0..842275e0fa 100644 --- a/synapse/types.py +++ b/synapse/types.py
@@ -17,6 +17,7 @@ import string from collections import namedtuple import attr +from six.moves import filter from synapse.api.errors import SynapseError @@ -240,7 +241,8 @@ def strip_invalid_mxid_characters(localpart): Returns: localpart (basestring): the localpart having been stripped """ - return filter(lambda c: c in mxid_localpart_allowed_characters, localpart) + filtered = filter(lambda c: c in mxid_localpart_allowed_characters, localpart) + return "".join(list(filtered)) UPPER_CASE_PATTERN = re.compile(b"[A-Z_]")