Skip to content

Commit

Permalink
Removed spaces with multiple MIME types
Browse files Browse the repository at this point in the history
If multiple MIME-types are specified, this will get rid of any extra spaces between them.

`audio/mp3, audio/m4v`

becomes

`audio/mp3,audio/m4v`

for parsing successfully.
  • Loading branch information
Michael Phillips committed Dec 6, 2012
1 parent 3d02806 commit 2fbe406
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion additional-methods.js
Expand Up @@ -404,7 +404,7 @@ jQuery.validator.addMethod("skip_or_fill_minimum", function(value, element, opti
// Accept a value from a file input based on a required mimetype
jQuery.validator.addMethod("accept", function(value, element, param) {
// Split mime on commas incase we have multiple types we can accept
var typeParam = typeof param === "string" ? param.replace(/,/g, '|') : "image/*",
var typeParam = typeof param === "string" ? param.replace(/\s/g, '').replace(/,/g, '|') : "image/*",
optionalValue = this.optional(element),
i, file;

Expand Down

0 comments on commit 2fbe406

Please sign in to comment.