Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed extList2mimes function where mimes was used and overriden at the same time #1667

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions js/moxie.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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_;
};


Expand Down