dfssfd
This commit is contained in:
parent
4a2c67ab2d
commit
377ce6b23a
3 changed files with 6 additions and 18 deletions
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue