From 8e710ded7c51b63a7aeefc0d07cf2da2e4abf714 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 3 Nov 2021 16:03:26 +0200 Subject: [PATCH] fdsdfs --- files/classes/comment.py | 2 +- files/helpers/sanitize.py | 2 +- files/routes/search.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index cd9592b42..a0558fa24 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -347,7 +347,7 @@ class Comment(Base): @lazy def collapse_for_user(self, v): - if self.over_18 and not (v and v.over_18) and not self.post.over_18: return True + if self.over_18 and not (v and v.over_18) and not (self.post and self.post.over_18): return True if not v: return False diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 99de8af18..33d514d0c 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -75,7 +75,7 @@ no_images = ['b', 'span', ] -allowed_attributes = {'*': ['href', 'style', 'src', 'class', 'title', 'rel', 'data-bs-original-name', 'direction']} +allowed_attributes = {'*': ['href', 'style', 'src', 'class', 'title', 'rel', 'data-bs-original-name', 'direction', 'behavior']} allowed_protocols = ['http', 'https'] diff --git a/files/routes/search.py b/files/routes/search.py index f60d91f91..0629d7d8e 100644 --- a/files/routes/search.py +++ b/files/routes/search.py @@ -186,7 +186,7 @@ def searchcomments(v): except: page = 1 sort = request.values.get("sort", "new").lower() - t = request.values.get('t', 'week').lower() + t = "day" criteria=searchparse(query)