diff --git a/files/routes/static.py b/files/routes/static.py
index 4abf0efcb..f4d149d0b 100644
--- a/files/routes/static.py
+++ b/files/routes/static.py
@@ -196,25 +196,13 @@ def submit_contact(v):
if not body: abort(400)
body = f'This message has been sent automatically to all admins via [/contact](/contact)\n\nMessage:\n\n' + body
+
+ body += process_files()
+
+ body = body.strip()
+
body_html = sanitize(body)
- if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1":
- files = request.files.getlist('file')[:4]
- for file in files:
- if file.content_type.startswith('image/'):
- name = f'/images/{time.time()}'.replace('.','') + '.webp'
- file.save(name)
- url = process_image(v.patron, name)
- body_html += f''
- elif file.content_type.startswith('video/'):
- body_html += f"
{process_video(file)}
" - elif file.content_type.startswith('audio/'): - body_html += f"{process_audio(file)}
" - else: - body_html += f"{process_other(file)}
" - - - new_comment = Comment(author_id=v.id, parent_submission=None, level=1, diff --git a/files/routes/users.py b/files/routes/users.py index d969a4ef4..8de008884 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -723,24 +723,13 @@ def messagereply(v): if parent.sentto == 2: user_id = None elif v.id == user_id: user_id = parent.sentto + if parent.sentto == 2: + body += process_files() + + body = body.strip() + body_html = sanitize(message) - if parent.sentto == 2 and request.files.get("file") and request.headers.get("cf-ipcountry") != "T1": - files = request.files.getlist('file')[:4] - for file in files: - if file.content_type.startswith('image/'): - name = f'/images/{time.time()}'.replace('.','') + '.webp' - file.save(name) - url = process_image(v.patron, name) - body_html += f'{process_video(file)}
" - elif file.content_type.startswith('audio/'): - body_html += f"{process_audio(file)}
" - else: - body_html += f"{process_other(file)}
" - - c = Comment(author_id=v.id, parent_submission=None, parent_comment_id=id,