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=[]