fix: Limit link chars to letters and numbers
All checks were successful
Build Docker / Build Main Image (push) Successful in 20s

This commit is contained in:
2023-11-17 10:55:00 +11:00
parent e0d2e89c55
commit a1122419e9
2 changed files with 6 additions and 0 deletions

View File

@@ -114,6 +114,10 @@ def add_link():
if len(link) < 5:
return error('Link too short')
regexmatch = re.match(r"^[a-zA-Z0-9]+$", link)
if not regexmatch:
return error('Invalid link')
# Verify link is not taken
if db.get_link(link) != False:
return error('Link already taken')