From 31dab50f5d983dab89bd66f9163b97bd0738185b Mon Sep 17 00:00:00 2001 From: Greg ORIOL Date: Thu, 18 Jul 2024 16:15:08 +0200 Subject: [PATCH] Fixed extList2mimes function where mimes was used and overriden at the same time --- js/moxie.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/js/moxie.js b/js/moxie.js index 65f33166c..fd1efa8cd 100644 --- a/js/moxie.js +++ b/js/moxie.js @@ -3471,7 +3471,7 @@ define("moxie/core/utils/Mime", [ var extList2mimes = function (filters, addMissingExtensions) { - var ext, i, ii, type, mimes = []; + var ext, i, ii, type, mimes_ = []; // convert extensions to mime types list for (i = 0; i < filters.length; i++) { @@ -3488,16 +3488,17 @@ define("moxie/core/utils/Mime", [ // future browsers should filter by extension, finally if (addMissingExtensions && /^\w+$/.test(ext[ii])) { - mimes.push('.' + ext[ii]); - } else if (type && Basic.inArray(type, mimes) === -1) { - mimes.push(type); + mimes_.push('.' + ext[ii]); + } else if (type && Basic.inArray(type, mimes_) === -1) { + mimes_.push(type); } else if (!type) { // if we have no type in our map, then accept all return []; } } } - return mimes; + + return mimes_; };