summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-05-14 13:11:28 +0100
committerDavid Baker <dave@matrix.org>2015-05-14 13:11:28 +0100
commit0c894e1ebdb204cf0a0dce16ed819b9e5d9f3fc0 (patch)
tree983b116d9b173a6b744e4c902302876fdc679a6b /synapse
parentMake shared secret registration work again (diff)
downloadsynapse-0c894e1ebdb204cf0a0dce16ed819b9e5d9f3fc0.tar.xz
Throw error when creating room if alias contains whitespace #SYN-335
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/room.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index dac683616a..401cc677d1 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -26,6 +26,7 @@ from synapse.util.async import run_on_reactor
 from synapse.events.utils import serialize_event
 
 import logging
+import string
 
 logger = logging.getLogger(__name__)
 
@@ -50,6 +51,10 @@ class RoomCreationHandler(BaseHandler):
         self.ratelimit(user_id)
 
         if "room_alias_name" in config:
+            for wchar in string.whitespace:
+                if wchar in config["room_alias_name"]:
+                    raise SynapseError(400, "Invalid characters in room alias")
+
             room_alias = RoomAlias.create(
                 config["room_alias_name"],
                 self.hs.hostname,