diff --git a/files/classes/comment.py b/files/classes/comment.py index f425226aff..0423a5d327 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -328,7 +328,8 @@ class Comment(Base): @lazy def realbody(self, v): - if self.post and self.post.club and not (v and (v.paid_dues or v.id in [self.author_id, self.parent_comment.author_id, self.top_comment.author_id, self.post.author_id])): return f"

{CC} ONLY

" + if self.post and self.post.club and not (v and (v.paid_dues or v.id in [self.author_id, self.post.author_id] or (self.parent_comment and v.id == self.parent_comment.author_id))): + return f"

{CC} ONLY

" body = self.body_html or "" @@ -392,7 +393,8 @@ class Comment(Base): @lazy def plainbody(self, v): - if self.post and self.post.club and not (v and (v.paid_dues or v.id in [self.author_id, self.parent_comment.author_id, self.top_comment.author_id, self.post.author_id])): return f"

{CC} ONLY

" + if self.post and self.post.club and not (v and (v.paid_dues or v.id in [self.author_id, self.post.author_id] or (self.parent_comment and v.id == self.parent_comment.author_id))): + return f"{CC} ONLY" body = self.body diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 526e11d64b..d6ec18c8a1 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -220,7 +220,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys sanitized = strikethrough_regex.sub(r'\1\2', sanitized) - sanitized = sanitized.replace('‎','').replace('​','').replace("\ufeff", "").replace("𒐪","") + sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace("\ufeff", "").replace("𒐪","").replace("\u0589", ":") sanitized = reddit_regex.sub(r'\1/\2', sanitized) sanitized = sub_regex.sub(r'\1/\2', sanitized) diff --git a/files/routes/posts.py b/files/routes/posts.py index 2eb00167bf..826a9c8b5d 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -1112,6 +1112,9 @@ def toggle_comment_nsfw(cid, v): if comment.author_id != v.id and not v.admin_level > 1 and not (comment.post.sub and v.mods(comment.post.sub)): abort(403) + + if comment.over_18 and v.is_suspended_permanently: + abort(403) comment.over_18 = not comment.over_18 g.db.add(comment) @@ -1134,6 +1137,9 @@ def toggle_post_nsfw(pid, v): if post.author_id != v.id and not v.admin_level > 1 and not (post.sub and v.mods(post.sub)): abort(403) + + if post.over_18 and v.is_suspended_permanently: + abort(403) post.over_18 = not post.over_18 g.db.add(post)