mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
Fix word bounds on filters, where they would only be applied at the beginning (#61714)
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -20,6 +20,14 @@
|
||||
null,
|
||||
)
|
||||
|
||||
test_filter(
|
||||
"these words have filtered words in them: ablockedinic blockedinicbbbb aablockedinicbb",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
)
|
||||
|
||||
test_filter(
|
||||
"<(0_0<) <(0_0)> (>0_0)> KIRBY DANCE!!!",
|
||||
"<(0_0<)",
|
||||
|
||||
Reference in New Issue
Block a user