mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 15:17:01 +01:00
[MIRROR] Fix word bounds on filters, where they would only be applied at the beginning [MDB IGNORE] (#8444)
* Fix word bounds on filters, where they would only be applied at the beginning (#61714) * Fix word bounds on filters, where they would only be applied at the beginning Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
@@ -427,7 +427,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