diff --git a/files/helpers/const.py b/files/helpers/const.py index 6ffa8c71d..f5bf8f8ab 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -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) diff --git a/files/routes/comments.py b/files/routes/comments.py index 1912f584f..4a7bbd1c6 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -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