From d1beb2e1ad72b239b2e9c6671cf244cf91cd0618 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 16 Oct 2022 16:24:49 -0700 Subject: [PATCH] Fix file verification on upload; just block folders (#4442) --- resources/scripts/components/server/files/UploadButton.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/scripts/components/server/files/UploadButton.tsx b/resources/scripts/components/server/files/UploadButton.tsx index 51225d6997..25277456d1 100644 --- a/resources/scripts/components/server/files/UploadButton.tsx +++ b/resources/scripts/components/server/files/UploadButton.tsx @@ -67,7 +67,7 @@ export default ({ className }: WithClassname) => { const onFileSubmission = (files: FileList) => { clearAndAddHttpError(); const list = Array.from(files); - if (list.some((file) => !file.type && file.size % 4096 === 0)) { + if (list.some((file) => !file.size || (!file.type && file.size === 4096))) { return addError('Folder uploads are not supported at this time.', 'Error'); }