From 19e6e7f4d9c4e8b4382eb9885ba0e52f9d0c256c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 29 Jun 2022 03:37:44 +0200 Subject: [PATCH] no longer stop reposts from being posted (just give the warning and that's it) --- files/routes/posts.py | 29 ----------------------------- files/templates/submit.html | 4 +++- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 6d5f78fc6..ab8ebecf1 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -764,35 +764,6 @@ def submit_post(v, sub=None): parsed_url = urlparse(url) domain = parsed_url.netloc - if domain in ('old.reddit.com','twitter.com','instagram.com','tiktok.com'): - new_url = ParseResult(scheme="https", - netloc=parsed_url.netloc, - path=parsed_url.path, - params=parsed_url.params, - query=None, - fragment=parsed_url.fragment) - else: - qd = parse_qs(parsed_url.query) - filtered = {k: val for k, val in qd.items() if not k.startswith('utm_') and not k.startswith('ref_')} - - new_url = ParseResult(scheme="https", - netloc=parsed_url.netloc, - path=parsed_url.path, - params=parsed_url.params, - query=urlencode(filtered, doseq=True), - fragment=parsed_url.fragment) - - url = urlunparse(new_url) - - if url.endswith('/'): url = url[:-1] - - search_url = url.replace('%', '').replace('\\', '').replace('_', '\_').strip() - repost = g.db.query(Submission).filter( - Submission.url.ilike(search_url), - Submission.deleted_utc == 0, - Submission.is_banned == False - ).first() - if repost and SITE != 'localhost': return redirect(repost.permalink) domain_obj = get_domain(domain) if not domain_obj: domain_obj = get_domain(domain+parsed_url.path) diff --git a/files/templates/submit.html b/files/templates/submit.html index a668c3b59..672d060e2 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -107,7 +107,9 @@
- To post an image, use a direct image link such as i.imgur.com +

+ To post an image, use a direct image link such as i.imgur.com +