RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.04k stars 10.33k forks source link

Bad Words filter seems to be catching 'Hello' #9880

Open RichardFoxworthy opened 6 years ago

RichardFoxworthy commented 6 years ago

Description:

The bad words filter seems to now be triggering on partial matches - eg it will now filter out the word 'hello', presumably because it includes the word 'hell'. Which I don't consider to be a bad word any way, but whatevs ....

Server Setup Information:

Steps to Reproduce:

  1. Set 'Allow Message bad words filtering' to 'True' under Admin --> Settings --> Message
  2. Go to any channel and send a message that includes the word 'hello'

Expected behavior:

  1. I expect the word 'hello' to be rendered without modification
  2. If a word really is to be filtered I expect to see the same number of * as there are letters in that word - ie if hello really were to be filtered, I would expect to see '****' rather than ''

Actual behavior:

Message will be rendered with a single '*' in place of the word 'hello'

Relevant logs:

NA

nemani commented 6 years ago

For me the word hello is rendered as *****

nemani commented 6 years ago

I looked into this issue, seems like its a problem with the package we are using. https://github.com/web-mech/badwords/issues/25

nemani commented 6 years ago

We can either A: Switch to a different package, B: fix this issue in the upstream or C: Write our own filter.

nemani commented 6 years ago

I looked into the library, and to filter words like shitshit, it looks for bad words anywhere in the given word. This causes a lot more problems as words like document and title also get filtered. I think its better to have exact matching of bad words.

didierhk commented 6 years ago

mongodb and cluster are also being filtered

knrt10 commented 5 years ago

@RichardFoxworthy I think this issue is fixed in 1.0.0-develop. Try checking it. Cheers 👍