From 5808301770495a4a404d2065a2cec22a3914b083 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Tue, 19 Mar 2024 12:42:53 +1300 Subject: [PATCH] remove '?asdf' stuff on the end of file names when saving --- app/activitypub/util.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/activitypub/util.py b/app/activitypub/util.py index 461d8077..ea3ffe0e 100644 --- a/app/activitypub/util.py +++ b/app/activitypub/util.py @@ -704,6 +704,9 @@ def make_image_sizes_async(file_id, thumbnail_width, medium_width, directory): content_type_parts = content_type.split('/') if content_type_parts: file_ext = '.' + content_type_parts[-1] + else: + if '?' in file_ext: + file_ext = file_ext.split('?')[0] new_filename = gibberish(15)