From 2fbe406995e07c93584dfc98bcaf612c066abe65 Mon Sep 17 00:00:00 2001 From: Michael Phillips Date: Thu, 6 Dec 2012 17:52:02 -0500 Subject: [PATCH] Removed spaces with multiple MIME types 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. --- additional-methods.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/additional-methods.js b/additional-methods.js index eb9dbee..96d5224 100644 --- a/additional-methods.js +++ b/additional-methods.js @@ -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;