Skip to content

Commit

Permalink
Fixed so that all file types can be selected if you don't specify a f…
Browse files Browse the repository at this point in the history
…ilter setting.
  • Loading branch information
spocke committed Apr 23, 2010
1 parent cd0721b commit 57400dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Expand Up @@ -3,6 +3,7 @@ Version 1.2.2 (2010-xx-xx)
Added new FILE_SIZE_ERROR type that will be triggered if the user selected a file that is to large or zero bytes.
Added new FILE_EXTENSION_ERROR type that will be triggered if you add a file with an invalid file extension.
Fixed so the plupload.buildUrl function uses the UTF compatible encodeURIComponent method instead of escape.
Fixed so that all file types can be selected if you don't specify a filter setting.
Fixed some issues with the HTML4 runtime if there wasn't any existing forms on the page.
Fixed some conflict issues with HTML4 runtime and forms with the input names of action or target.
Fixed bug where some Gecko versions would produce exceptions when checking the HTTP status of a XHR.
Expand Down
10 changes: 4 additions & 6 deletions src/javascript/plupload.js
Expand Up @@ -590,9 +590,7 @@
max_file_size : '1gb',
multi_selection : true,
file_data_name : 'file',
filters : [
{title : "Image files", extensions : "jpg,gif,png"}
]
filters : []
}, settings);

// Private methods
Expand Down Expand Up @@ -722,13 +720,13 @@

// Add files to queue
self.bind('FilesAdded', function(up, selected_files) {
var i, file, count = 0, extensionsMap;
var i, file, count = 0, extensionsMap, filters = settings.filters;

// Convert extensions to map
if (settings.filters) {
if (filters && filters.length) {
extensionsMap = {};

plupload.each(settings.filters, function(filter) {
plupload.each(filters, function(filter) {
plupload.each(filter.extensions.split(/,/), function(ext) {
extensionsMap[ext] = true;
});
Expand Down

0 comments on commit 57400dd

Please sign in to comment.