Skip to content

Commit

Permalink
change: made link regexes stricter by enforcing at least one characte…
Browse files Browse the repository at this point in the history
…r match.
  • Loading branch information
namemcguffin committed Aug 6, 2021
1 parent 9aeb5fb commit 83d49be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cogs/sanitizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
import re
import requests

TIKTOK_SHORTLINK = re.compile(r"https?:\/\/vm\.tiktok\.com\/[A-Za-z0-9]*")
TIKTOK_SHORTLINK = re.compile(r"https?:\/\/vm\.tiktok\.com\/[A-Za-z0-9]+")
TIKTOK_MOBILE = re.compile(
r"(https?:\/\/m\.tiktok\.com\/v\/[0-9]*)\.html\?[A-Za-z0-9_&=%\.\?-]*")
r"(https?:\/\/m\.tiktok\.com\/v\/[0-9]+)\.html\?[A-Za-z0-9_&=%\.\?-]+")
TIKTOK_DESKTOP = re.compile(
r"(https?:\/\/www\.tiktok\.com\/@[A-Za-z0-9_\.]*\/video\/[0-9]*)\?[A-Za-z0-9_&=%\.\?-]*"
r"(https?:\/\/www\.tiktok\.com\/@[A-Za-z0-9_\.]+\/video\/[0-9]+)\?[A-Za-z0-9_&=%\.\?-]+"
)


Expand Down

0 comments on commit 83d49be

Please sign in to comment.