summary refs log tree commit diff
path: root/synapse/handlers/register.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2023-07-11 12:21:00 -0400
committerGitHub <noreply@github.com>2023-07-11 12:21:00 -0400
commita4243183f0b500f9f30f2d24af19f30a99f65f63 (patch)
treef3590f5a33f30f814452f70377a8f1352d02898a /synapse/handlers/register.py
parentDon't build wheels for Python 3.7 (#15917) (diff)
downloadsynapse-a4243183f0b500f9f30f2d24af19f30a99f65f63.tar.xz
Add + as an allowed character for Matrix IDs (MSC4009) (#15911)
Diffstat (limited to 'synapse/handlers/register.py')
-rw-r--r--synapse/handlers/register.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py

index a2d3f03061..3a55056df5 100644 --- a/synapse/handlers/register.py +++ b/synapse/handlers/register.py
@@ -143,15 +143,10 @@ class RegistrationHandler: assigned_user_id: Optional[str] = None, inhibit_user_in_use_error: bool = False, ) -> None: - if types.contains_invalid_mxid_characters( - localpart, self.hs.config.experimental.msc4009_e164_mxids - ): - extra_chars = ( - "=_-./+" if self.hs.config.experimental.msc4009_e164_mxids else "=_-./" - ) + if types.contains_invalid_mxid_characters(localpart): raise SynapseError( 400, - f"User ID can only contain characters a-z, 0-9, or '{extra_chars}'", + "User ID can only contain characters a-z, 0-9, or '=_-./+'", Codes.INVALID_USERNAME, )