summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-10-19 10:26:50 +0100
committerErik Johnston <erik@matrix.org>2018-10-24 09:54:57 +0100
commit47a9ba435d9a4b9e311d9d9a3c02be105942f357 (patch)
treeaee81c7e27767d0443ab5f50f96399549a25f24f
parentAdd tests for alias creation rules (diff)
downloadsynapse-47a9ba435d9a4b9e311d9d9a3c02be105942f357.tar.xz
Use match rather than search
-rw-r--r--synapse/config/room_directory.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/config/room_directory.py b/synapse/config/room_directory.py
index 41ef3217e8..2ca010afdb 100644
--- a/synapse/config/room_directory.py
+++ b/synapse/config/room_directory.py
@@ -92,10 +92,11 @@ class _AliasRule(object):
             boolean
         """
 
-        if not self._user_id_regex.search(user_id):
+        # Note: The regexes are anchored at both ends
+        if not self._user_id_regex.match(user_id):
             return False
 
-        if not self._alias_regex.search(alias):
+        if not self._alias_regex.match(alias):
             return False
 
         return True