RocketChat / RocketChat/Rocket.Chat

Bad-words filter only works for roman character

Open
#12,430 1 comment 1 reaction 1 assignee View on GitHub

@sampaiodiego is already working on this.

Since Mar 19, 2020.

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

Description

Description:

The bad-words filter, only seems to respect roman characters.

I could imagine this is because the default regex is used in the library:

https://github.com/web-mech/badwords/blob/e15b99e41ebf794503148b80699914ebcf12f173/lib/badwords.js#L21

There is a mention of multi-lingual support with an example in the project README.md:

var filter = new Filter({ replaceRegex:  /[A-Za-z0-9가-힣_]/g }); 
//multilingual support for word filtering
Steps to reproduce:
  1. Go to admin UI → Message

  2. Now set ...

    • "Allow Message bad words filtering" to True
    • "Add Bad Words to the Blacklist" to test,example,Привет
  3. Save configuration

  4. Go to any channel and send a message with the content: test,example,Привет

Expected behavior:

All of the configured "bad words" should be censored:

frdmn: ***,*******,******
Actual behavior:
frdmn: ***,*******,Привет
Server Setup Information:
  • Version of Rocket.Chat Server: 0.70.4
  • Operating System: Cloud
  • Deployment Method: Cloud
  • Number of Running Instances: Cloud
  • DB Replicaset Oplog: Cloud
  • NodeJS Version: Cloud
  • MongoDB Version: Cloud
Additional context
screen shot 2018-10-26 at 10 21 35

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.