From 391a054e699cebc22b9e14a272383b5a344b042e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 11 Dec 2021 19:42:34 +0200 Subject: [PATCH 1/6] fsdfsd --- files/routes/static.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/files/routes/static.py b/files/routes/static.py index 1dad043fb2..d49033681f 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -262,11 +262,10 @@ def static_service(path): return resp @app.get('/images/') -@app.get('/IMAGES/') @app.get('/hostedimages/') @limiter.exempt def images(path): - resp = make_response(send_from_directory('images', path.replace('.WEBP','.webp'))) + resp = make_response(send_from_directory('./images', path.replace('.WEBP','.webp'))) resp.headers.remove("Cache-Control") resp.headers.add("Cache-Control", "public, max-age=2628000") if request.path.endswith('.webp'): From dafb4298226f2c1ec56477713ac024cdde6f18f7 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 11 Dec 2021 19:44:29 +0200 Subject: [PATCH 2/6] fdssfd --- files/helpers/markdown.py | 2 +- files/routes/static.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/files/helpers/markdown.py b/files/helpers/markdown.py index 55caa7432e..ef072ae92a 100644 --- a/files/helpers/markdown.py +++ b/files/helpers/markdown.py @@ -81,7 +81,7 @@ class CustomRenderer(HTMLRenderer): if not user: return f"{space}@{target}" - return f'''{space}@{username}'s profile picture@{user.username}''' + return f'''{space}@{user.username}'s profile picture@{user.username}''' def render_sub_mention(self, token): space = token.target[0] diff --git a/files/routes/static.py b/files/routes/static.py index d49033681f..1db18456a4 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -265,6 +265,7 @@ def static_service(path): @app.get('/hostedimages/') @limiter.exempt def images(path): + print('wtf') resp = make_response(send_from_directory('./images', path.replace('.WEBP','.webp'))) resp.headers.remove("Cache-Control") resp.headers.add("Cache-Control", "public, max-age=2628000") From 3a6334d9773a2495739d28d59ca0a50adcef1b37 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 11 Dec 2021 19:48:06 +0200 Subject: [PATCH 3/6] sdfsdf --- files/routes/static.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/static.py b/files/routes/static.py index 1db18456a4..cce0c6f3fc 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -266,7 +266,7 @@ def static_service(path): @limiter.exempt def images(path): print('wtf') - resp = make_response(send_from_directory('./images', path.replace('.WEBP','.webp'))) + resp = make_response(send_from_directory('../images', path.replace('.WEBP','.webp'))) resp.headers.remove("Cache-Control") resp.headers.add("Cache-Control", "public, max-age=2628000") if request.path.endswith('.webp'): From 5d5c2a9ed4d387e493219d44c59a278cdb322d3a Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 11 Dec 2021 19:48:43 +0200 Subject: [PATCH 4/6] fdsfds --- files/routes/static.py | 1 - 1 file changed, 1 deletion(-) diff --git a/files/routes/static.py b/files/routes/static.py index cce0c6f3fc..fd35707b4d 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -265,7 +265,6 @@ def static_service(path): @app.get('/hostedimages/') @limiter.exempt def images(path): - print('wtf') resp = make_response(send_from_directory('../images', path.replace('.WEBP','.webp'))) resp.headers.remove("Cache-Control") resp.headers.add("Cache-Control", "public, max-age=2628000") From 5549588e7f815d235b6018321b3c16fc57560cd3 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 11 Dec 2021 19:53:06 +0200 Subject: [PATCH 5/6] fsdsdf --- files/helpers/sanitize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index cead164997..bf286cec4b 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -205,7 +205,7 @@ def sanitize(sanitized, noimages=False): for i in re.finditer('" target="_blank">(https://youtube\.com/watch\?v\=(.*?))', sanitized): url = i.group(1) yt_id = i.group(2).split('&')[0].split('%')[0] - replacing = f'{url}' + replacing = f'{url}' params = parse_qs(urlparse(url.replace('&','&')).query) t = params.get('t', params.get('start', [0]))[0] From fa9cb897e853ea87590eae4ef3d5592b0d9a4841 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 11 Dec 2021 20:08:03 +0200 Subject: [PATCH 6/6] fsdfds --- files/routes/posts.py | 2 +- files/templates/admin/apps.html | 2 +- files/templates/comments.html | 6 +++--- files/templates/contact.html | 4 ++-- files/templates/settings_filters.html | 6 +++--- files/templates/sign_up.html | 2 +- files/templates/submission.html | 4 ++-- files/templates/submission_listing.html | 6 +++--- files/templates/submit.html | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 0a2c613370..b3ff39d044 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -697,7 +697,7 @@ def thumbnail_thread(pid): for chunk in image_req.iter_content(1024): file.write(chunk) - post.thumburl = "https://" + site + process_image(name, True) + post.thumburl = f"https://{site}/" + process_image(name, True) db.add(post) db.commit() db.close() diff --git a/files/templates/admin/apps.html b/files/templates/admin/apps.html index 07e3e4d875..bf9cd895f8 100644 --- a/files/templates/admin/apps.html +++ b/files/templates/admin/apps.html @@ -14,7 +14,7 @@
diff --git a/files/templates/comments.html b/files/templates/comments.html index 6c799a80d6..230db87a7f 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -57,7 +57,7 @@ coins      - + View @@ -295,7 +295,7 @@ Cancel
- +
{% endif %}
@@ -463,7 +463,7 @@ Cancel
- +
diff --git a/files/templates/contact.html b/files/templates/contact.html index deb999b8d0..81884571f6 100644 --- a/files/templates/contact.html +++ b/files/templates/contact.html @@ -50,11 +50,11 @@ {% elif v %} -

Please verify your email address in order to ensure we can respond to your message if needed. Then, refresh this page.

+

Please verify your email address in order to ensure we can respond to your message if needed. Then, refresh this page.

{% else %} -

In order to ensure that we can respond to your message, please first sign up or log in and make sure you have verified your email address. Then, refresh this page.

+

In order to ensure that we can respond to your message, please first sign up or log in and make sure you have verified your email address. Then, refresh this page.

{% endif %} diff --git a/files/templates/settings_filters.html b/files/templates/settings_filters.html index 59d0ec75cd..b344288081 100644 --- a/files/templates/settings_filters.html +++ b/files/templates/settings_filters.html @@ -105,7 +105,7 @@
- +
@@ -115,7 +115,7 @@
- Enable if you would like to automatically open threads in new tabs. + Enable if you would like to automatically open links to other pages in the site in new tabs.
@@ -135,7 +135,7 @@
- Enable if you would like to automatically open external links in new tabs. + Enable if you would like to automatically open links to other sites in new tabs. diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 2417c8d898..c4687f4fc9 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -111,7 +111,7 @@
+ href="/rules" {% if v and v.newtab %}target="_blank"{% endif %}>terms and conditions
{% if hcaptcha %} diff --git a/files/templates/submission.html b/files/templates/submission.html index f5536d1560..6b1b34b640 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -470,7 +470,7 @@ Cancel
- + {% endif %} @@ -734,7 +734,7 @@ Comment
- + {% if not v and not p.is_banned %} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index cb52dadc9a..d818414ce0 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -45,7 +45,7 @@ coins      - + View @@ -185,7 +185,7 @@ {{p.author.username}}{% if p.author.customtitle %}  {% if p.author.quadrant %}{% endif %}{{p.author.customtitle | safe}}{% endif %}  {{p.age_string}}   - ({% if p.realurl(v) %}{{p.domain}}{% else %}text post{% endif %}) + ({% if p.realurl(v) %}{{p.domain}}{% else %}text post{% endif %}) {% if p.edited_utc %}   Edited {{p.edited_string}} {% endif %} @@ -474,7 +474,7 @@ {% if p.is_image and not p.over_18 and ((v and v.cardview) or (not v and environ.get('CARD_VIEW') == '1')) %} diff --git a/files/templates/submit.html b/files/templates/submit.html index 38d6a81baf..eb4b8ea141 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -126,7 +126,7 @@

-												
+