master
Aevann1 2021-12-10 22:02:02 +02:00
parent 12e35f26d2
commit 331b37a8b9
1 changed files with 2 additions and 8 deletions

View File

@ -335,10 +335,7 @@ def edit_post(pid, v):
if p.author_id != v.id and not (v.admin_level > 1 and v.admin_level > 2): abort(403)
title = request.values.get("title", "").strip().replace(' ','\n')
for i in re.finditer('(^|\n)(?!.*http)(.*)', title):
title = title.replace(i.group(2), i.group(2).upper())
title = title.replace('\n\n','%&$').replace('\n',' ').replace('%&$','\n\n')
title = request.values.get("title", "").strip().upper()
body = request.values.get("body", "").strip().replace(' ','\n')
for i in re.finditer('(^|\n)(?!.*http)(.*)', body):
@ -676,10 +673,7 @@ def submit_post(v):
if request.content_length > 8 * 1024 * 1024: return "Max file size is 8 MB.", 413
elif request.content_length > 4 * 1024 * 1024: return "Max file size is 4 MB.", 413
title = request.values.get("title", "").strip()[:500].replace(' ','\n')
for i in re.finditer('(^|\n)(?!.*http)(.*)', title):
title = title.replace(i.group(2), i.group(2).upper())
title = title.replace('\n\n','%&$').replace('\n',' ').replace('%&$','\n\n')
title = request.values.get("title", "").strip()[:500].upper()
url = request.values.get("url", "").strip()