[FIX] Empty white list enables all media types upload (#1077)

This commit is contained in:
Diego Mello 2019-07-29 13:48:40 -03:00 committed by GitHub
parent d80dd0e2ce
commit ec987b1a75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -166,8 +166,9 @@ export default class UploadModal extends Component {
if (file.size > FileUpload_MaxFileSize) {
return false;
}
// if white list is empty, all media types are enabled
if (!FileUpload_MediaTypeWhiteList) {
return false;
return true;
}
const allowedMime = FileUpload_MediaTypeWhiteList.split(',');
if (allowedMime.includes(file.mime)) {