Skip to content

Correct Discord Invite Regex #129

@mbaruh

Description

@mbaruh

The current invite regex is too permissive. It captures any non-space character, while invite codes can only have letters and numbers.

r"(?P<invite>\S+)", # the invite code itself

In c9daa6f we made it go until the whitespace because of the way the Discord client parses invites, but we can safely account for it by adding / to the character class instead (i.e [a-zA-Z0-9/-]).

Metadata

Metadata

Assignees

No one assigned

    Labels

    s: planningA feature being considered or discussed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions