Skip to content

Commit c1241d5

Browse files
ChrisLoveringsebkuip
authored andcommitted
Escape hyphen in regex string
Unescaped this was permitting any character between $ (index 36) and _ (index 95), which aren't all valid in urls.
1 parent 6c820bf commit c1241d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/thread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ async def send(
995995
attachments.append(attachment)
996996

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

0 commit comments

Comments
 (0)