remotes/1693045480750635534/spooky-22
Aevann1 2021-09-02 16:38:33 +02:00
parent f7cb9a8aeb
commit 4bbebb326d
2 changed files with 12 additions and 7 deletions

View File

@ -285,9 +285,10 @@ def api_comment(v):
body_md = renderer.render(mistletoe.Document(body))
body_html = sanitize(body_md)
if len(body_html) > 20000: abort(400)
c_aux = CommentAux(
id=c.id,
body_html=body_html[:20000],
body_html=body_html,
body=body[:10000]
)
@ -661,8 +662,10 @@ def edit_comment(cid, v):
body_md = renderer.render(mistletoe.Document(body))
body_html = sanitize(body_md)
if len(body_html) > 20000: abort(400)
c.body = body[:10000]
c.body_html = body_html[:20000]
c.body_html = body_html
if "rdrama" in request.host and "ivermectin" in c.body_html.lower():
@ -690,8 +693,8 @@ def edit_comment(cid, v):
body_jannied_html = sanitize(body_md)
c_aux = CommentAux(
id=c_jannied.id,
body_html=body_jannied_html[:20000],
body=body[:10000]
body_html=body_jannied_html,
body=body
)
g.db.add(c_aux)
g.db.flush()
@ -725,8 +728,8 @@ def edit_comment(cid, v):
body_jannied_html = sanitize(body_md)
c_aux = CommentAux(
id=c_jannied.id,
body_html=body_jannied_html[:20000],
body=body[:10000]
body_html=body_jannied_html,
body=body
)
g.db.add(c_aux)
g.db.flush()

View File

@ -117,8 +117,10 @@ def settings_profile_post(v):
v.ban(days=30, reason="Digitally malicious content is not allowed.")
return {"error": reason}, 401
if len(bio_html) > 10000: abort(400)
v.bio = bio[:1500]
v.bio_html=bio_html[:10000]
v.bio_html=bio_html
g.db.add(v)
return render_template("settings_profile.html",
v=v,