Fix file verification on upload; just block folders (#4442)

This commit is contained in:
Dane Everitt 2022-10-16 16:24:49 -07:00 committed by GitHub
parent 9c6822f62d
commit d1beb2e1ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,7 +67,7 @@ export default ({ className }: WithClassname) => {
const onFileSubmission = (files: FileList) => { const onFileSubmission = (files: FileList) => {
clearAndAddHttpError(); clearAndAddHttpError();
const list = Array.from(files); 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'); return addError('Folder uploads are not supported at this time.', 'Error');
} }