Skip to content

Commit

Permalink
Escape hyphen in regex string
Browse files Browse the repository at this point in the history
Unescaped this was permitting any character between $ (index 36) and _ (index 95), which aren't all valid in urls.
  • Loading branch information
ChrisLovering committed Jul 31, 2023
1 parent f8b1eb3 commit 07eae40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ async def send(
attachments.append(attachment)

image_urls = re.findall(
r"http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+",
r"http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[$\-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+",
message.content,
)

Expand Down

0 comments on commit 07eae40

Please sign in to comment.