fix: Check correct form value for regex
All checks were successful
Build Docker / Build Main Image (push) Successful in 21s

This commit is contained in:
Nathan Woodburn 2023-11-17 00:26:45 +11:00
parent 994ca7e1e7
commit 46b49d588d
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -104,7 +104,7 @@ def add_link():
if not (url.startswith('http://') or url.startswith('https://')):
url = 'https://' + url
regexmatch = re.match(r"^https?://([a-z0-9]+(-[a-z0-9]+)*\.)*([a-z0-9]+(-[a-z0-9]+)*)(/([a-z0-9.])+(-([a-z0-9.])+)?)*$", domain)
regexmatch = re.match(r"^https?://([a-z0-9]+(-[a-z0-9]+)*\.)*([a-z0-9]+(-[a-z0-9]+)*)(/([a-z0-9.])+(-([a-z0-9.])+)?)*$", url)
if not regexmatch:
return error('Invalid domain')