From 25615d7ee0a239aac2eebdf5fb9606eb97f308d3 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 2 Jun 2020 18:53:33 +0200 Subject: [PATCH] fix not working file upload, if not mime-type specified --- api/js/etemplate/et2_widget_file.js | 2 ++ api/js/etemplate/et2_widget_file.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/api/js/etemplate/et2_widget_file.js b/api/js/etemplate/et2_widget_file.js index 90f1333b95..88dbbf3022 100644 --- a/api/js/etemplate/et2_widget_file.js +++ b/api/js/etemplate/et2_widget_file.js @@ -281,6 +281,8 @@ var et2_file = /** @class */ (function (_super) { * @return boolean */ et2_file.prototype.checkMime = function (f) { + if (!this.options.mime) + return true; var mime = ''; if (this.options.mime.indexOf("/") != 0) { // Lower case it now, if it's not a regex diff --git a/api/js/etemplate/et2_widget_file.ts b/api/js/etemplate/et2_widget_file.ts index 8d3ed0c062..e0fe1460b6 100644 --- a/api/js/etemplate/et2_widget_file.ts +++ b/api/js/etemplate/et2_widget_file.ts @@ -403,6 +403,8 @@ export class et2_file extends et2_inputWidget */ checkMime(f) { + if(!this.options.mime) return true; + let mime: string | RegExp = ''; if(this.options.mime.indexOf("/") != 0) {