From 95d8e9fe250e4d58450d0dd4c62ace231da39745 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 23 Feb 2022 08:01:54 +0200 Subject: [PATCH] sfd --- files/helpers/filters.py | 4 ++-- files/routes/posts.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/helpers/filters.py b/files/helpers/filters.py index dbde828983..0b9f70f128 100644 --- a/files/helpers/filters.py +++ b/files/helpers/filters.py @@ -5,7 +5,7 @@ from files.classes import BannedDomain def filter_comment_html(html_text): - soup = BeautifulSoup(html_text, 'xml') + soup = BeautifulSoup(html_text, 'html.parser') links = soup.find_all("a") @@ -28,7 +28,7 @@ def filter_comment_html(html_text): new_domain += "." + parts[j] domain_list.add(new_domain) - bans = [x for x in g.db.query(BannedDomain).filter(BannedDomain.domain.in_(list(domain_list))).all()] + bans = tuple(x for x in g.db.query(BannedDomain).filter(BannedDomain.domain.in_(list(domain_list))).all()) if bans: return bans else: return [] diff --git a/files/routes/posts.py b/files/routes/posts.py index 5e3ec477c6..edba5495d2 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -670,7 +670,7 @@ def thumbnail_thread(pid): if x.headers.get("Content-Type","").startswith("text/html"): - soup=BeautifulSoup(x.content, 'xml') + soup=BeautifulSoup(x.content, 'html.parser') thumb_candidate_urls=[]