From 0995f70eb352ab2cc34d59b99e75784839733fa8 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 28 Feb 2022 02:13:07 +0200 Subject: [PATCH] fd --- files/routes/awards.py | 8 ++++---- files/routes/login.py | 4 ++-- files/templates/userpage.html | 2 +- files/templates/userpage_comments.html | 2 +- files/templates/userpage_private.html | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index e0ae4d5b4..ee88053c7 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -421,8 +421,8 @@ def award_post(pid, v): g.db.commit() if request.referrer and len(request.referrer) > 1: if request.referrer == f'{SITE_FULL}/submit': return redirect(post.permalink) - elif request.host in request.referrer: return redirect(request.referrer) - return redirect(f"{SITE_FULL}/") + elif request.referrer.startswith(request.host): return redirect(request.referrer) + return redirect(SITE_FULL) @app.post("/award_comment/") @@ -646,9 +646,9 @@ def award_comment(cid, v): g.db.add(author) g.db.commit() - if request.referrer and len(request.referrer) > 1 and request.host in request.referrer: + if request.referrer and len(request.referrer) > 1 and request.referrer.startswith(request.host): return redirect(request.referrer) - return redirect(f"{SITE_FULL}/") + return redirect(SITE_FULL) @app.get("/admin/awards") @admin_level_required(2) diff --git a/files/routes/login.py b/files/routes/login.py index b4c9633ea..7c415e404 100644 --- a/files/routes/login.py +++ b/files/routes/login.py @@ -179,7 +179,7 @@ def sign_up_get(v): if f.read() == "yes": return {"error": "New account registration is currently closed. Please come back later."}, 403 - if v: return redirect(f"{SITE_FULL}/") + if v: return redirect(SITE_FULL) agent = request.headers.get("User-Agent", None) if not agent: abort(403) @@ -350,7 +350,7 @@ def sign_up_post(v): g.db.commit() - return redirect(f"{SITE_FULL}/") + return redirect(SITE_FULL) @app.get("/forgot") diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 3ad444206..2becbdee4 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -737,7 +737,7 @@ {% if v %}
{% if v.patron or u.patron or v.alts_patron or u.alts_patron %}0{% else %}0.03{% endif %}
- +
{{u.username}}
{% endif %} diff --git a/files/templates/userpage_comments.html b/files/templates/userpage_comments.html index 20fac42e0..279c1baa1 100644 --- a/files/templates/userpage_comments.html +++ b/files/templates/userpage_comments.html @@ -114,7 +114,7 @@ {% if v %}
{% if v.patron or u.patron %}0{% else %}0.03{% endif %}
- +
{{u.username}}
{% endif %} diff --git a/files/templates/userpage_private.html b/files/templates/userpage_private.html index eaee86b32..c2fbf2f11 100644 --- a/files/templates/userpage_private.html +++ b/files/templates/userpage_private.html @@ -48,7 +48,7 @@ {% if v %}
{% if v.patron or u.patron %}0{% else %}0.03{% endif %}
- +
{{u.username}}
{% endif %}