This commit is contained in:
Aevann1 2021-09-02 16:38:33 +02:00
parent 699213d7f6
commit 537c575b65
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()