diff --git a/code/controllers/configuration/configuration.dm b/code/controllers/configuration/configuration.dm index 685dd900b96..16411397e16 100644 --- a/code/controllers/configuration/configuration.dm +++ b/code/controllers/configuration/configuration.dm @@ -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. diff --git a/code/modules/unit_tests/chat_filter.dm b/code/modules/unit_tests/chat_filter.dm index b8fbaa16a31..ac59328a2f3 100644 --- a/code/modules/unit_tests/chat_filter.dm +++ b/code/modules/unit_tests/chat_filter.dm @@ -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<)",