Skip to content

Non-validated regex causes PatternSyntaxException #235

@Emirlol

Description

@Emirlol

Have you read the compatibility information above?

  • Yes, I have read and understand the compatibility note.

Mod Loader

Fabric

Game Version

1.21.9-1.21.10

Mod Version

2.4.21+edge

Environment Type

Multiplayer (Client)

Provide Your Logs

https://mclo.gs/roFXAvY

Describe Your Issue

Invalid regex in the mention keywords config causes PatternSyntaxException.

boolean isMention = messageString.matches(regex.toString());

According to the oracle docs, the matches method simply creates a Pattern with the given string and tries to match.

Note: I wasn't the one who encountered the issue, it was someone in fabric discord, I'm only reporting out of courtesy since I identified the problem. I'm not sure if the input for mentionKeywords in the config is validated/escaped elsewhere, I'm just going off the error.

Steps to Reproduce

  • Add invalid regex into mention keywords
  • Receive a message
  • Bug occurs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions