diff --git a/files/routes/admin.py b/files/routes/admin.py index 5bae0ee87..32833957b 100755 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -21,18 +21,6 @@ from files.helpers.discord import add_role SITE_NAME = environ.get("SITE_NAME", "").strip() -@app.get("/justice") -@admin_level_required(6) -def justice(v): - for id in [261,1832,1833]: - u = g.db.query(User).options(lazyload('*')).filter_by(id = id).first() - if u: - u.comment_count = g.db.query(Comment).options(lazyload('*')).filter_by(author_id = id).count() - g.db.add(u) - g.db.commit() - return "sex" - - @app.get("/truescore") @admin_level_required(6) def truescore(v): diff --git a/files/routes/comments.py b/files/routes/comments.py index 09d60a799..0e7912d44 100755 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -191,7 +191,7 @@ def api_comment(v): body_md = CustomRenderer().render(mistletoe.Document(body_md)) body_html = sanitize(body_md) - if v.marseyawarded and len(list(re.finditer('>[^<]|[^>]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 403 + if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 403 bans = filter_comment_html(body_html) @@ -618,7 +618,7 @@ def edit_comment(cid, v): body_md = CustomRenderer().render(mistletoe.Document(body)) body_html = sanitize(body_md) - if v.marseyawarded and len(list(re.finditer('>[^<]|[^>]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 403 + if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 403 bans = filter_comment_html(body_html) diff --git a/files/routes/posts.py b/files/routes/posts.py index a6252c36b..149019c68 100755 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -227,7 +227,7 @@ def edit_post(pid, v): if title != p.title: title_html = filter_title(title) - if v.marseyawarded and len(list(re.finditer('>[^<]|[^>]<', title_html))) > 0: return {"error":"You can only type marseys!"}, 403 + if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', title_html))) > 0: return {"error":"You can only type marseys!"}, 403 p.title = title p.title_html = title_html @@ -247,7 +247,7 @@ def edit_post(pid, v): return {"error": reason}, 403 p.body = body - if v.marseyawarded and len(list(re.finditer('>[^<]|[^>]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 40 + if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 40 p.body_html = body_html if "rama" in request.host and "ivermectin" in body_html.lower(): @@ -503,7 +503,7 @@ def submit_post(v): title = request.values.get("title", "").strip() url = request.values.get("url", "").strip() title_html = filter_title(title) - if v.marseyawarded and len(list(re.finditer('>[^<]|[^>]<', title_html))) > 0: return {"error":"You can only type marseys!"}, 40 + if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', title_html))) > 0: return {"error":"You can only type marseys!"}, 40 if url: if "/i.imgur.com/" in url: url = url.replace(".png", ".webp").replace(".jpg", ".webp").replace(".jpeg", ".webp") @@ -673,7 +673,7 @@ def submit_post(v): body_md = CustomRenderer().render(mistletoe.Document(body)) body_html = sanitize(body_md) - if v.marseyawarded and len(list(re.finditer('>[^<]|[^>]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 40 + if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 40 if len(body_html) > 20000: abort(400)