remotes/1693045480750635534/spooky-22
Aevann1 2022-04-25 16:51:40 +02:00
parent 94a190a46b
commit e60fe0bcd6
4 changed files with 2 additions and 16 deletions

View File

@ -89,6 +89,8 @@ def sanitize(sanitized, alert=False, comment=False, edit=False):
sanitized = linefeeds_regex.sub(r'\1\n\n\2', sanitized)
sanitized = image_regex.sub(r'\1![](\2)\4', sanitized)
sanitized = image_check_regex.sub(r'\1', sanitized)
sanitized = markdown(sanitized)

View File

@ -204,8 +204,6 @@ def api_comment(v):
if not body and not request.files.get('file'): return {"error":"You need to actually write something!"}, 400
body = image_regex.sub(r'\1![](\2)\4', body)
options = []
for i in poll_regex.finditer(body):
options.append(i.group(1))
@ -694,8 +692,6 @@ def edit_comment(cid, v):
elif v.bird and len(body) > 140:
return {"error":"You have to type less than 140 characters!"}, 403
body = image_regex.sub(r'\1![](\2)\4', body)
if v.agendaposter and not v.marseyawarded:
body = torture_ap(body, v.username)

View File

@ -474,8 +474,6 @@ def edit_post(pid, v):
else: return {"error": "Image/Video files only"}, 400
if body != p.body:
body = image_regex.sub(r'\1![](\2)\4', body)
if v.id == p.author_id and v.agendaposter and not v.marseyawarded: body = torture_ap(body, v.username)
if not p.options.count():
@ -1054,8 +1052,6 @@ def submit_post(v, sub=None):
if len(url) > 2048:
return error("There's a 2048 character limit for URLs.")
body = image_regex.sub(r'\1![](\2)\4', body)
if v and v.admin_level > 2:
bet_options = []
for i in bet_regex.finditer(body):

View File

@ -136,8 +136,6 @@ def settings_profile_post(v):
elif (v.patron or v.id == MOOSE_ID) and request.values.get("sig"):
sig = request.values.get("sig")[:200]
sig = image_regex.sub(r'\1![](\2)\4', sig)
sig_html = sanitize(sig)
if len(sig_html) > 1000:
@ -159,8 +157,6 @@ def settings_profile_post(v):
elif request.values.get("friends"):
friends = request.values.get("friends")[:500]
friends = image_regex.sub(r'\1![](\2)\4', friends)
friends_html = sanitize(friends)
if len(friends_html) > 2000:
@ -188,8 +184,6 @@ def settings_profile_post(v):
elif request.values.get("enemies"):
enemies = request.values.get("enemies")[:500]
enemies = image_regex.sub(r'\1![](\2)\4', enemies)
enemies_html = sanitize(enemies)
if len(enemies_html) > 2000:
@ -217,8 +211,6 @@ def settings_profile_post(v):
elif request.values.get("bio") or request.files.get('file') and request.headers.get("cf-ipcountry") != "T1":
bio = request.values.get("bio")[:1500]
bio = image_regex.sub(r'\1![](\2)\4', bio)
if request.files.get('file'):
file = request.files['file']
if file.content_type.startswith('image/'):