Skip to content

Commit

Permalink
make _isValid return a valid extension if the mimetype is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
webzwo0i committed Nov 29, 2021
1 parent c7f766d commit 38a8a71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion static/js/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const _handleNewLines = (ace) => {
const _isValid = (file) => {
const mimedb = clientVars.ep_image_upload.mimeTypes;
const mimeType = mimedb[file.type];
const extension = mimeType ? mimeType.extensions[0] : null;
let validMime = null;
if (clientVars.ep_image_upload && clientVars.ep_image_upload.fileTypes) {
validMime = false;
Expand Down Expand Up @@ -44,7 +45,7 @@ const _isValid = (file) => {
return false;
}

return true;
return extension;
};
exports._isValid = _isValid;

Expand Down

0 comments on commit 38a8a71

Please sign in to comment.