forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2022-03-01 03:40:43 +02:00
parent f8b886e9f4
commit 412495e2f9
2 changed files with 3 additions and 1 deletions

View File

@ -656,6 +656,8 @@ valid_password_regex = re.compile("^.{8,100}$", flags=re.A)
marsey_regex = re.compile("^(:[!#A-Za-z0-9]{1,30}?:\s*)+$", flags=re.A)
marsey_regex2 = re.compile("[a-z0-9]{1,30}", flags=re.A)
image_regex = re.compile("(^https:\/\/.*\.(png|jpg|jpeg|gif|webp|maxwidth=9999|fidelity=high)($|\s))", flags=re.I|re.M|re.A)
valid_sub_regex = re.compile("^[a-zA-Z0-9_\-]{3,20}$", flags=re.A)

View File

@ -268,7 +268,7 @@ def api_comment(v):
marsey = loads(body.lower())
name = marsey["name"]
if not marsey_regex.fullmatch(name):
if not marsey_regex2.fullmatch(name):
return {"error": "Invalid name!"}, 403
if "author" in marsey: author_id = get_user(marsey["author"]).id