Fix word bounds on filters, where they would only be applied at the beginning (#61714)

This commit is contained in:
Mothblocks
2021-09-27 20:38:49 -07:00
committed by GitHub
parent 563cb1d9b5
commit 1f000babea
2 changed files with 9 additions and 1 deletions

View File

@@ -430,7 +430,7 @@ Example config:
to_join_on_whitespace_splits += REGEX_QUOTE(banned_word)
var/whitespace_split = @"(?:(?:^|\s+)(" + jointext(to_join_on_whitespace_splits, "|") + @")(?:$|\s+))"
var/word_bounds = @"(\b(" + jointext(to_join_on_word_bounds, "|") + "))"
var/word_bounds = @"(\b(" + jointext(to_join_on_word_bounds, "|") + @")\b)"
return regex("([whitespace_split]|[word_bounds])", "i")
//Message admins when you can.