fddf
This commit is contained in:
parent
0b8dc4aaa6
commit
b2718a9c29
1 changed files with 4 additions and 5 deletions
|
@ -520,9 +520,11 @@ def filter_title(title):
|
||||||
def submit_post(v):
|
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:
|
||||||
|
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),
|
||||||
|
@ -544,9 +546,6 @@ def submit_post(v):
|
||||||
if request.headers.get("Authorization"): return {"error": "500 character limit for titles"}, 400
|
if request.headers.get("Authorization"): return {"error": "500 character limit for titles"}, 400
|
||||||
else: render_template("submit.html", v=v, error="500 character limit for titles.", title=title[:500], url=url, body=request.form.get("body", "")), 400
|
else: render_template("submit.html", v=v, error="500 character limit for titles.", title=title[:500], url=url, body=request.form.get("body", "")), 400
|
||||||
|
|
||||||
elif "<" in title:
|
|
||||||
render_template("submit.html", v=v, error="Titles can't contain <", title=title[:500], url=url, body=request.form.get("body", "")), 400
|
|
||||||
|
|
||||||
parsed_url = urlparse(url)
|
parsed_url = urlparse(url)
|
||||||
if not (parsed_url.scheme and parsed_url.netloc) and not request.form.get(
|
if not (parsed_url.scheme and parsed_url.netloc) and not request.form.get(
|
||||||
"body") and not request.files.get("file", None):
|
"body") and not request.files.get("file", None):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue