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 filtering does not work as expected #14283

Open nguyentuandat opened 5 years ago

nguyentuandat commented 5 years ago

Description:

I enable Allow Message bad words filtering feature and it does not work as expected Seem 2nd keywords or utf-8 keywords were not filtered.

Steps to reproduce:

  1. Go to settings, enable Allow Message bad words filtering.
  2. Add some keywords as string: cho, meo or chó, mèo.
  3. Click Save changes

bad words

  1. Go to channel and enter enter one of cho, meo, chó, mèo

Expected behavior:

Should be show as ***

Actual behavior:

just cho is show as ***, chó still show chó meo or mèo (not 1st keyword) still show as original (because of space before keywords).

Server Setup Information:

Additional context

Relevant logs:

knrt10 commented 5 years ago

On it, will try to fix this.

knrt10 commented 5 years ago

This problem is with bad-words npm package we are using. I have opened an issue there. https://github.com/web-mech/badwords/issues/53.