Fixed missing check for maximum allowed files in files field

This commit is contained in:
Djamil Legato
2019-06-18 19:02:31 -07:00
parent 8f07fcb790
commit 2e85583141
4 changed files with 41 additions and 34 deletions

View File

@@ -5,6 +5,7 @@
* Moved Remodal in-house and added support for stackable modals [#1698](https://github.com/getgrav/grav-plugin-admin/issues/1698), [#1699](https://github.com/getgrav/grav-plugin-admin/issues/1699)
1. [](#bugfix)
* Fixed issue with charts in dashboard where label would cut off [#1700](https://github.com/getgrav/grav-plugin-admin/issues/1700)
* Fixed missing check for maximum allowed files in `files` field
# v1.10.0-beta.1
## 06/14/2019

View File

@@ -79,6 +79,12 @@ const ACCEPT_FUNC = function(file, done, settings) {
setTimeout(() => {
let error = '';
if ((this.options.maxFiles != null) && (this.getAcceptedFiles().length >= this.options.maxFiles)) {
done(this.options.dictMaxFilesExceeded.replace('{{maxFiles}}', this.options.maxFiles));
return this.emit('maxfilesexceeded', file);
}
if (resolution.min) {
Object.keys(resolution.min).forEach((attr) => {
if (resolution.min[attr] && file[attr] < resolution.min[attr]) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long