mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-26 19:47:05 +03:00
Fix branch didn't check word_boundary
This commit is contained in:
parent
5cd2126a6a
commit
47f82e4408
1 changed files with 9 additions and 3 deletions
|
@ -273,10 +273,16 @@ def _glob_matches(glob, value, word_boundary=False):
|
||||||
),
|
),
|
||||||
r,
|
r,
|
||||||
)
|
)
|
||||||
r = r + "$"
|
if word_boundary:
|
||||||
r = re.compile(r, flags=re.IGNORECASE)
|
r = "\b%s\b" % (r,)
|
||||||
|
r = re.compile(r, flags=re.IGNORECASE)
|
||||||
|
|
||||||
return r.match(value)
|
return r.search(value)
|
||||||
|
else:
|
||||||
|
r = r + "$"
|
||||||
|
r = re.compile(r, flags=re.IGNORECASE)
|
||||||
|
|
||||||
|
return r.match(value)
|
||||||
elif word_boundary:
|
elif word_boundary:
|
||||||
r = re.escape(glob)
|
r = re.escape(glob)
|
||||||
r = "\b%s\b" % (r,)
|
r = "\b%s\b" % (r,)
|
||||||
|
|
Loading…
Reference in a new issue