summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2021-05-11 10:49:45 +0100
committerBrendan Abolivier <babolivier@matrix.org>2021-05-11 10:49:45 +0100
commit6157f02067b0053da77c6537801fa48b2edf9319 (patch)
treebcd82ba443f8336f98d2e0d0af77c5a2a0005bcf
parentAlways cache 'event_to_prev_state_group' (diff)
downloadsynapse-6157f02067b0053da77c6537801fa48b2edf9319.tar.xz
Revert "improve efficiency of _glob_to_re"
This reverts commit edac710bc0c4dc1cd226d9ffe73a00b42c2b67d8.
-rw-r--r--synapse/push/push_rule_evaluator.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/synapse/push/push_rule_evaluator.py b/synapse/push/push_rule_evaluator.py

index ae077af5b5..49ecb38522 100644 --- a/synapse/push/push_rule_evaluator.py +++ b/synapse/push/push_rule_evaluator.py
@@ -230,8 +230,7 @@ def _glob_to_re(glob: str, word_boundary: bool) -> Pattern: if IS_GLOB.search(glob): r = re.escape(glob) - # replace 1 or more repeats of `\*` with `.*?` - r = re.sub(r"(\\\*)+", ".*?", r) + r = r.replace(r"\*", ".*?") r = r.replace(r"\?", ".") # handle [abc], [a-z] and [!a-z] style ranges.