From 5a2afff7bb21bb8669a000e5ecc017a8eb081c44 Mon Sep 17 00:00:00 2001 From: atrc445 Date: Thu, 19 Aug 2021 21:41:59 +0200 Subject: [PATCH] fix filtering in notificaitons/userpages --- files/routes/posts.py | 4 ---- files/routes/settings.py | 5 ----- files/templates/comments.html | 12 ++++++------ files/templates/submission.html | 4 ++-- seed-db.sql | 2 +- 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index c7d6965abe..ff8e173ebf 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -228,7 +228,6 @@ def post_id(pid, anything=None, v=None): def edit_post(pid, v): title = request.form.get("title") - if "<" in title: return {"error": f"Titles can't contain <"} p = get_post(pid) @@ -522,9 +521,6 @@ def submit_post(v): title = request.form.get("title", "") url = request.form.get("url", "") - if "<" in title: - return render_template("submit.html", v=v, error="Titles can't contain <", title=title[:500], url=url, body=request.form.get("body", "")), 400 - if url: repost = g.db.query(Submission).join(Submission.submission_aux).filter( SubmissionAux.url.ilike(url), diff --git a/files/routes/settings.py b/files/routes/settings.py index a47c5efa2c..6055523eb4 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -677,11 +677,6 @@ def settings_title_change(v): new_name=request.form.get("title").strip()[:100] - if "<" in new_name: - return render_template("settings_profile.html", - v=v, - error=f"Flairs can't contain <") - #make sure name is different if new_name==v.customtitle: return render_template("settings_profile.html", diff --git a/files/templates/comments.html b/files/templates/comments.html index 2a2f4527e9..8fe6e1bbbb 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -82,15 +82,15 @@ {% if c.parent_submission %} {% if c.author_id==v.id and c.child_comments and is_notification_page%} - Comment {{'Replies' if (c.child_comments | length)>1 else 'Reply'}}: {{c.post.title | safe}} + Comment {{'Replies' if (c.child_comments | length)>1 else 'Reply'}}: {{c.post.realtitle(v) | safe}} {% elif c.post.author_id==v.id and c.level == 1 and is_notification_page%} - Post Reply: {{c.post.title | safe}} + Post Reply: {{c.post.realtitle(v) | safe}} {% elif is_notification_page and c.parent_submission in v.subscribed_idlist() %} - Subscribed Thread: {{c.post.title | safe}} + Subscribed Thread: {{c.post.realtitle(v) | safe}} {% elif is_notification_page %} - Username Mention: {{c.post.title | safe}} + Username Mention: {{c.post.realtitle(v) | safe}} {% else %} - {{c.post.title | safe}} + {{c.post.realtitle(v) | safe}} {% endif %} {% elif c.author_id==1046 or c.author_id==2360 %} {{'SITE_NAME' | app_config}} Notification @@ -511,4 +511,4 @@ - \ No newline at end of file + diff --git a/files/templates/submission.html b/files/templates/submission.html index fca6c83200..359755e82d 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -52,7 +52,7 @@ {% endif %} {% else %} -{{p.title | safe}} - {{'SITE_NAME' | app_config}} +{{p.title}} - {{'SITE_NAME' | app_config}} @@ -634,4 +634,4 @@ {% include "gif_modal.html" %} {% include "emoji_modal.html" %} {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/seed-db.sql b/seed-db.sql index fc88b293a8..69c5d8a835 100644 --- a/seed-db.sql +++ b/seed-db.sql @@ -1 +1 @@ -INSERT INTO public.badge_defs VALUES (6, 'Beta User', 'Joined during open beta', 'beta.png', 4, 3, NULL); +INSERT INTO public.badge_defs VALUES (6, 'Beta User', 'Joined during open beta', 'beta.png', 3, NULL);