From 6acb07bc929f9d469e73bccd0e0795a6b7216a72 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 13 Aug 2021 03:29:21 +0200 Subject: [PATCH] fddf --- files/routes/front.py | 3 +++ files/routes/posts.py | 16 +++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 70e91a82c4..e2040f236a 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -183,11 +183,14 @@ def frontlist(v=None, sort="hot", page=1,t="all", ids_only=True, filter_words='' return posts, next_exists @app.get("/") +@app.get("/logged_out") @auth_desired def front_all(v): if v and v.is_banned and not v.unban_utc: return render_template("seized.html") + if not v and request.path == "/": return redirect("/logged_out") + try: page = int(request.args.get("page") or 1) except: abort(400) diff --git a/files/routes/posts.py b/files/routes/posts.py index 1a9ae61514..132ac20bdf 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -491,17 +491,23 @@ def archiveorg(url): @app.route("/embed/post/", methods=["GET"]) def embed_post_pid(pid): - post = get_post(pid) + try: pid = int(pid) + except: abort(400) - return render_template("embeds/post.html", p=post) + post = get_post(pid) + + return render_template("embeds/post.html", p=post) @app.route("/embed/comment/", methods=["GET"]) def embed_comment_cid(cid, pid=None): - comment = get_comment(cid) + try: cid = int(cid) + except: abort(400) - return render_template("embeds/comment.html", c=comment) + comment = get_comment(cid) + + return render_template("embeds/comment.html", c=comment) @app.post("/submit") @@ -830,7 +836,7 @@ def submit_post(v): g.db.flush() - # spin off thumbnail generation and csam detection as new threads + # spin off thumbnail generation and csam detection as new threads if (new_post.url or request.files.get('file')) and (v.is_activated or request.headers.get('cf-ipcountry')!="T1"): thumbs(new_post) notify_users = set()