RocketChat / RocketChat/Rocket.Chat
Invalid “UTF8 Names Validation” regexp breaks channels
Open
Nobody has claimed this yet.
feat: app settings
type: bug
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
Server Setup Information:
- Version of Rocket.Chat Server: 0.59.3
- Operating System: Linux
- Deployment Method(snap/docker/tar/etc): Rocket Chat Cloud
- Number of Running Instances: ?
- DB Replicaset Oplog: ?
- Node Version: v4.8.4
Steps to Reproduce:
- Go to administrative UI » General » UTF8
- Enter an invalid regular expression, such as:
/([0-9a-zæøåA-ZÆØÅ-_.]+)/ - Save.
- Reload normal UI.
- Click a channel.
Expected behavior:
One of two options:
- The UI works as normal, but now allows channel names containing the Danish special characters Æ, Ø and Å.
- Otherwise, I get an error when attempting to save the setting due to its invalid value.
Actual behavior:
The setting is saved, and I get the following JavaScript error when rendering channels:
SyntaxError: Invalid regular expression: /@([0-9a-zæøåA-ZÆØÅ-_.]+)/: Range out of order in character class
The error breaks channel rendering completely.
Relevant logs:
I no longer have any relevant logs, sorry.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the administrative UI's General » UTF8 setting and trace how the saved regular expression is consumed when rendering channels. Reproduce with /([0-9a-zæøåA-ZÆØÅ-_.]+)/ and verify that an invalid expression is rejected on save or that valid Danish characters work without breaking channel rendering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100