diff options
author | 2022-05-10 23:14:57 +0400 | |
---|---|---|
committer | 2022-05-10 23:14:57 +0400 | |
commit | 47936d5485315e847b8b28ec5a4b9c706a28b935 (patch) | |
tree | b45536c6c9bf56db1940bfea4a27219f6723c350 /botcore | |
parent | Merge pull request #74 from python-discord/dependabot/pip/flake8-tidy-imports... (diff) | |
parent | Convert tests from pytest style to unittest style (diff) |
Merge pull request from GHSA-xq5g-8594-cfxp
Advisory fix 1
Diffstat (limited to 'botcore')
-rw-r--r-- | botcore/utils/regex.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/botcore/utils/regex.py b/botcore/utils/regex.py index abcaf299..8eb38ba2 100644 --- a/botcore/utils/regex.py +++ b/botcore/utils/regex.py @@ -11,13 +11,17 @@ DISCORD_INVITE = re.compile( r"discord([.,]|dot)io|" # or discord.io. r"((?<!\w)([.,]|dot))gg" # or .gg/ r")([/]|slash)" # / or 'slash' - r"(?P<invite>[a-zA-Z0-9\-]+)", # the invite code itself + r"(?P<invite>\S+)", # the invite code itself flags=re.IGNORECASE ) """ Regex for Discord server invites. :meta hide-value: +.. warning:: + This regex pattern will capture until a whitespace, if you are to use the 'invite' capture group in + any HTTP requests or similar. Please ensure you sanitise the output using something similar to + https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote. """ FORMATTED_CODE_REGEX = re.compile( |