summary refs log tree commit diff
path: root/synapse/handlers/directory.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-05-18 13:50:01 +0100
committerMark Haines <mark.haines@matrix.org>2015-05-18 13:50:01 +0100
commit0b0033c40b29fd78384863bce932b31ebe281d95 (patch)
tree1e56a17d193b01f12c3bb5b897274f8753ed3531 /synapse/handlers/directory.py
parentMake sure the notifier stream token goes forward when it is updated. Sort the... (diff)
parentMerge pull request #153 from matrix-org/markjh/presence_docstring (diff)
downloadsynapse-0b0033c40b29fd78384863bce932b31ebe281d95.tar.xz
Merge branch 'develop' into notifier_performance
Diffstat (limited to 'synapse/handlers/directory.py')
-rw-r--r--synapse/handlers/directory.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py
index f76febee8f..e41a688836 100644
--- a/synapse/handlers/directory.py
+++ b/synapse/handlers/directory.py
@@ -22,6 +22,7 @@ from synapse.api.constants import EventTypes
 from synapse.types import RoomAlias
 
 import logging
+import string
 
 logger = logging.getLogger(__name__)
 
@@ -40,6 +41,10 @@ class DirectoryHandler(BaseHandler):
     def _create_association(self, room_alias, room_id, servers=None):
         # general association creation for both human users and app services
 
+        for wchar in string.whitespace:
+                if wchar in room_alias.localpart:
+                    raise SynapseError(400, "Invalid characters in room alias")
+
         if not self.hs.is_mine(room_alias):
             raise SynapseError(400, "Room alias must be local")
             # TODO(erikj): Change this.