RocketChat / RocketChat/Rocket.Chat

Bad words filtering does not work as expected

Open
#14,283 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

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:
  • Version of Rocket.Chat Server: 1.0.0-develop
  • Operating System: CentOS 7
  • Deployment Method: manual
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: 8.x
  • MongoDB Version: 3.6.12
Additional context
Relevant logs:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the bad-word filtering cases described in the issue: multiple space-separated keywords and keywords containing UTF-8 characters. Trace the implementation used after enabling the Allow Message bad words filtering setting, then verify that every configured keyword is masked in channel messages and that the existing behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.