diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 4a82cfcf9c..cb0345212b 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -366,7 +366,8 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys href = link.get("href") if not href: continue url = urlparse(href) - domain_list.add(url.netloc + url.path) + d = tldextract.extract(href).registered_domain + url.path + domain_list.add(d) banned_domains = g.db.query(BannedDomain).all() for x in banned_domains: diff --git a/files/routes/posts.py b/files/routes/posts.py index 64fc3208d3..c098970777 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -783,7 +783,7 @@ def submit_post(v, sub=None): if repost and FEATURES['REPOST_DETECTION'] and not v.admin_level >= PERMS['POST_BYPASS_REPOST_CHECKING']: return redirect(repost.permalink) - y = domain + parsed_url.path + y = tldextract.extract(url).registered_domain + parsed_url.path banned_domains = g.db.query(BannedDomain).all() for x in banned_domains: if y.startswith(x.domain):