dfs
This commit is contained in:
parent
d4224042f6
commit
21f4f6f8e7
3 changed files with 6 additions and 4 deletions
|
@ -38,8 +38,8 @@ class Comment(Base):
|
|||
oauth_app = relationship("OauthApp", viewonly=True)
|
||||
upvotes = Column(Integer, default=1)
|
||||
downvotes = Column(Integer, default=0)
|
||||
body = deferred(Column(String(20000)))
|
||||
body_html = deferred(Column(String(40000)))
|
||||
body = deferred(Column(String(10000)))
|
||||
body_html = deferred(Column(String(20000)))
|
||||
ban_reason = Column(String(256))
|
||||
|
||||
post = relationship("Submission", viewonly=True)
|
||||
|
|
|
@ -272,7 +272,7 @@ def api_comment(v):
|
|||
body_md = CustomRenderer().render(mistletoe.Document(body))
|
||||
body_html = sanitize(body_md)
|
||||
|
||||
if len(body_html) > 40000: abort(400)
|
||||
if len(body_html) > 20000: abort(400)
|
||||
|
||||
c = Comment(author_id=v.id,
|
||||
parent_submission=parent_submission,
|
||||
|
@ -691,7 +691,7 @@ def edit_comment(cid, v):
|
|||
body_md = CustomRenderer().render(mistletoe.Document(body))
|
||||
body_html = sanitize(body_md)
|
||||
|
||||
if len(body_html) > 40000: abort(400)
|
||||
if len(body_html) > 20000: abort(400)
|
||||
|
||||
c.body = body[:10000]
|
||||
c.body_html = body_html
|
||||
|
|
|
@ -780,6 +780,8 @@ def submit_post(v):
|
|||
body_md = CustomRenderer().render(mistletoe.Document(body))
|
||||
body_html = sanitize(body_md)
|
||||
|
||||
if len(body_html) > 20000: abort(400)
|
||||
|
||||
# Run safety filter
|
||||
bans = filter_comment_html(body_html)
|
||||
if bans:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue