aboutsummaryrefslogtreecommitdiffstats
path: root/botcore
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-05-10 23:14:57 +0400
committerGravatar GitHub <[email protected]>2022-05-10 23:14:57 +0400
commit47936d5485315e847b8b28ec5a4b9c706a28b935 (patch)
treeb45536c6c9bf56db1940bfea4a27219f6723c350 /botcore
parentMerge pull request #74 from python-discord/dependabot/pip/flake8-tidy-imports... (diff)
parentConvert 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.py6
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(