Fix mimetype regex

Regex was only replacing the first * when having multiple mimetypes.
For example image/*,video/*
This commit is contained in:
juadielon
2013-01-24 17:35:42 +10:00
committed by Jörn Zaefferer
parent 315189301a
commit 72345a461e

View File

@@ -413,7 +413,7 @@ jQuery.validator.addMethod("accept", function(value, element, param) {
if ($(element).attr("type") === "file") {
// If we are using a wildcard, make it regex friendly
typeParam = typeParam.replace("*", ".*");
typeParam = typeParam.replace(/\*/g, ".*");
// Check if the element has a FileList before checking each file
if (element.files && element.files.length) {