master
Aevann1 2021-08-20 07:53:35 +02:00
commit 418e608f52
5 changed files with 50 additions and 18 deletions

View File

@ -228,7 +228,6 @@ def post_id(pid, anything=None, v=None):
def edit_post(pid, v): def edit_post(pid, v):
title = request.form.get("title") title = request.form.get("title")
if "<" in title: return {"error": f"Titles can't contain <"}
p = get_post(pid) p = get_post(pid)
@ -522,9 +521,6 @@ def submit_post(v):
title = request.form.get("title", "") title = request.form.get("title", "")
url = request.form.get("url", "") 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: if url:
repost = g.db.query(Submission).join(Submission.submission_aux).filter( repost = g.db.query(Submission).join(Submission.submission_aux).filter(
SubmissionAux.url.ilike(url), SubmissionAux.url.ilike(url),

View File

@ -677,11 +677,6 @@ def settings_title_change(v):
new_name=request.form.get("title").strip()[:100] 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 #make sure name is different
if new_name==v.customtitle: if new_name==v.customtitle:
return render_template("settings_profile.html", return render_template("settings_profile.html",

View File

@ -82,15 +82,15 @@
<span class="align-top"> <span class="align-top">
{% if c.parent_submission %} {% if c.parent_submission %}
{% if c.author_id==v.id and c.child_comments and is_notification_page%} {% if c.author_id==v.id and c.child_comments and is_notification_page%}
<span class="font-weight-bold">Comment {{'Replies' if (c.child_comments | length)>1 else 'Reply'}}: <a href="{{c.post.permalink}}">{{c.post.title | safe}}</a></span> <span class="font-weight-bold">Comment {{'Replies' if (c.child_comments | length)>1 else 'Reply'}}: <a href="{{c.post.permalink}}">{{c.post.realtitle(v) | safe}}</a></span>
{% elif c.post.author_id==v.id and c.level == 1 and is_notification_page%} {% elif c.post.author_id==v.id and c.level == 1 and is_notification_page%}
<span class="font-weight-bold">Post Reply: <a href="{{c.post.permalink}}">{{c.post.title | safe}}</a></span> <span class="font-weight-bold">Post Reply: <a href="{{c.post.permalink}}">{{c.post.realtitle(v) | safe}}</a></span>
{% elif is_notification_page and c.parent_submission in v.subscribed_idlist() %} {% elif is_notification_page and c.parent_submission in v.subscribed_idlist() %}
<span class="font-weight-bold">Subscribed Thread: <a href="{{c.post.permalink}}">{{c.post.title | safe}}</a></span> <span class="font-weight-bold">Subscribed Thread: <a href="{{c.post.permalink}}">{{c.post.realtitle(v) | safe}}</a></span>
{% elif is_notification_page %} {% elif is_notification_page %}
<span class="font-weight-bold">Username Mention: <a href="{{c.post.permalink}}">{{c.post.title | safe}}</a></span> <span class="font-weight-bold">Username Mention: <a href="{{c.post.permalink}}">{{c.post.realtitle(v) | safe}}</a></span>
{% else %} {% else %}
<span class="font-weight-bold"><a href="{{c.post.permalink}}">{{c.post.title | safe}}</a></span> <span class="font-weight-bold"><a href="{{c.post.permalink}}">{{c.post.realtitle(v) | safe}}</a></span>
{% endif %} {% endif %}
{% elif c.author_id==1046 or c.author_id==2360 %} {% elif c.author_id==1046 or c.author_id==2360 %}
<span class="font-weight-bold">{{'SITE_NAME' | app_config}} Notification</span> <span class="font-weight-bold">{{'SITE_NAME' | app_config}} Notification</span>
@ -511,4 +511,4 @@
</pre> </pre>
</body> </body>

View File

@ -52,7 +52,7 @@
{% endif %} {% endif %}
{% else %} {% else %}
<title>{{p.title | safe}} - {{'SITE_NAME' | app_config}}</title> <title>{{p.title}} - {{'SITE_NAME' | app_config}}</title>
<meta property="og:article:author" content="{{'@'+p.author.username}}" /> <meta property="og:article:author" content="{{'@'+p.author.username}}" />
@ -634,4 +634,4 @@
{% include "gif_modal.html" %} {% include "gif_modal.html" %}
{% include "emoji_modal.html" %} {% include "emoji_modal.html" %}
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@ -1 +1,42 @@
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);
INSERT INTO public.users (
id, username, passhash, created_utc, admin_level, over_18, is_activated, bio, bio_html, login_nonce, is_private,
unban_utc, original_username, customtitle, defaultsorting, defaulttime, namecolor, titlecolor, profileurl, bannerurl,
customtitleplain, themecolor, changelogsub, oldreddit, css, profilecss, coins, agendaposter, suicide_utc,
post_count, comment_count, background, verified
) VALUES (1046, 'Drama', '', 0, 0, true, true, '', '', 0, false,
0, 'Drama', '', 'hot', 'day', 'ff66ac', 'ff66ac', '', '',
'', 'ff66ac', false, false, '', '', 0, false, 0,
0, 0, '', true);
INSERT INTO public.users (
id, username, passhash, created_utc, admin_level, over_18, is_activated, bio, bio_html, login_nonce, is_private,
unban_utc, original_username, customtitle, defaultsorting, defaulttime, namecolor, titlecolor, profileurl, bannerurl,
customtitleplain, themecolor, changelogsub, oldreddit, css, profilecss, coins, agendaposter, suicide_utc,
post_count, comment_count, background, verified
) VALUES (2360, 'AutoJanny', '', 0, 0, true, true, '', '', 0, false,
0, 'AutoJanny', '', 'hot', 'day', 'ff66ac', 'ff66ac', '', '',
'', 'ff66ac', false, false, '', '', 0, false, 0,
0, 0, '', true);
INSERT INTO public.users (
id, username, passhash, created_utc, admin_level, over_18, is_activated, bio, bio_html, login_nonce, is_private,
unban_utc, original_username, customtitle, defaultsorting, defaulttime, namecolor, titlecolor, profileurl, bannerurl,
customtitleplain, themecolor, changelogsub, oldreddit, css, profilecss, coins, agendaposter, suicide_utc,
post_count, comment_count, background, verified
) VALUES (2317, 'Sneethe', '', 0, 0, true, true, '', '', 0, false,
0, 'Sneethe', '', 'hot', 'day', '30409f', '30409f', '', '',
'', '30409f', false, false, '', '', 0, false, 0,
0, 0, '', true);
INSERT INTO public.users (
id, username, passhash, created_utc, admin_level, over_18, is_activated, bio, bio_html, login_nonce, is_private,
unban_utc, original_username, customtitle, defaultsorting, defaulttime, namecolor, titlecolor, profileurl, bannerurl,
customtitleplain, themecolor, changelogsub, oldreddit, css, profilecss, coins, agendaposter, suicide_utc,
post_count, comment_count, background, verified
) VALUES (261, 'Snappy', '', 0, 0, true, true, '', '', 0, false,
0, 'Snappy', '', 'hot', 'day', '62ca56', 'e4432d', '', '',
'', '30409f', false, false, '', '', 0, false, 0,
0, 0, '', true);