Skip to content

Commit

Permalink
Fix file verification on upload; just block folders (#4442)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaneEveritt authored Oct 16, 2022
1 parent 9c6822f commit d1beb2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/scripts/components/server/files/UploadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down

0 comments on commit d1beb2e

Please sign in to comment.