mirror of
https://github.com/jquery-validation/jquery-validation.git
synced 2025-12-24 12:13:59 +01:00
Fix mimetype regex
Regex was only replacing the first * when having multiple mimetypes. For example image/*,video/*
This commit is contained in:
committed by
Jörn Zaefferer
parent
315189301a
commit
72345a461e
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user