banbuilder icon indicating copy to clipboard operation
banbuilder copied to clipboard

Banning correct words, such as classroom

Open jagermesh opened this issue 3 years ago • 5 comments

[orig] => this is our classroom
[clean] => this is our cl***room

jagermesh avatar Sep 10 '20 10:09 jagermesh

I have the same problem, is there a way to match whole words only? Thanks.

lukepass avatar Nov 23 '20 09:11 lukepass

I saw that you can pass a second argument to censorString and it will match whole words only:

public function censorString($string, $fullWords = false) // <-- defaults to false, you can put true to match whole words

lukepass avatar Nov 23 '20 09:11 lukepass

Yeah, but this will start showing other words which are in 99% cases must be hidden. For example f**k must be considered as bad either as part of other word or as separate word, so regardless of the $fullWords true or false.

jagermesh avatar Nov 23 '20 14:11 jagermesh

same problem with word asshole if we set fullwords to true, word classroom is passed but then word asshole is also passed.

harpreetsb avatar Dec 02 '20 01:12 harpreetsb

I would still set fullwords to true then add asshole to the dictionary so it will be filtered as a fullword.

rob4226 avatar May 04 '21 15:05 rob4226