Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Revert "Allow upper-case characters in mxids"
Browse files Browse the repository at this point in the history
This has already been reverted on develop and replaced with a better
implementation (see PR #2662), but because the 'allow upper-case characters'
commit got separately applied to both develop and matrix-org-hotfixes, it
hasn't been correctly reverted on matrix-org-hotfixes.
richvdh committed Nov 27, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 6c9d1e8 commit 39b9c83
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions synapse/handlers/register.py
Original file line number Diff line number Diff line change
@@ -15,14 +15,14 @@

"""Contains functions for registering clients."""
import logging
import urllib

from twisted.internet import defer

from synapse.api.errors import (
AuthError, Codes, SynapseError, RegistrationError, InvalidCaptchaError
)
from synapse.http.client import CaptchaServerHttpClient
from synapse import types
from synapse.types import UserID
from synapse.util.async import run_on_reactor
from ._base import BaseHandler
@@ -47,7 +47,7 @@ def __init__(self, hs):
@defer.inlineCallbacks
def check_username(self, localpart, guest_access_token=None,
assigned_user_id=None):
if urllib.quote(localpart.encode('utf-8')) != localpart:
if types.contains_invalid_mxid_characters(localpart):
raise SynapseError(
400,
"User ID can only contain characters a-z, 0-9, or '=_-./'",
@@ -253,7 +253,7 @@ def register_saml2(self, localpart):
"""
Registers email_id as SAML2 Based Auth.
"""
if urllib.quote(localpart) != localpart:
if types.contains_invalid_mxid_characters(localpart):
raise SynapseError(
400,
"User ID can only contain characters a-z, 0-9, or '=_-./'",

0 comments on commit 39b9c83

Please sign in to comment.