Fixed regression with files in admin not allowing types other than images (fixes #1737)

This commit is contained in:
Djamil Legato
2019-08-21 10:09:18 -07:00
parent 0eba228f71
commit 1ac925b117
3 changed files with 13 additions and 5 deletions

View File

@@ -1,3 +1,9 @@
# v1.9.9
## mm/dd/2019
1. [](#bugfix)
* Fixed regression with files in admin not allowing types other than images
# v1.9.8
## 08/11/2019

View File

@@ -79,7 +79,9 @@ const ACCEPT_FUNC = function(file, done, settings) {
const reader = new FileReader();
let error = '';
if (resolution.min || (!(settings.resizeWidth || settings.resizeHeight) && resolution.max)) {
const hasMin = (resolution.min && (resolution.min.width || resolution.min.height));
const hasMax = (resolution.max && (resolution.max.width || resolution.max.height));
if (hasMin || (!(settings.resizeWidth || settings.resizeHeight) && hasMax)) {
reader.onload = function(event) {
const image = new Image();
image.src = event.target.result;
@@ -102,13 +104,13 @@ const ACCEPT_FUNC = function(file, done, settings) {
}
}
done(error);
return error ? done(error) : done();
};
};
reader.readAsDataURL(file);
} else {
return done(error);
return error ? done(error) : done();
}
};

File diff suppressed because one or more lines are too long