diff options
author | Erik Johnston <erik@matrix.org> | 2018-10-19 10:26:50 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-10-24 09:54:57 +0100 |
commit | 47a9ba435d9a4b9e311d9d9a3c02be105942f357 (patch) | |
tree | aee81c7e27767d0443ab5f50f96399549a25f24f | |
parent | Add tests for alias creation rules (diff) | |
download | synapse-47a9ba435d9a4b9e311d9d9a3c02be105942f357.tar.xz |
Use match rather than search
-rw-r--r-- | synapse/config/room_directory.py | 5 |
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 |