Skip to content

Commit 72345a4

Browse files
juadielonjzaefferer
authored andcommitted
Fix mimetype regex
Regex was only replacing the first * when having multiple mimetypes. For example image/*,video/*
1 parent 3151893 commit 72345a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

additional-methods.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ jQuery.validator.addMethod("accept", function(value, element, param) {
413413

414414
if ($(element).attr("type") === "file") {
415415
// If we are using a wildcard, make it regex friendly
416-
typeParam = typeParam.replace("*", ".*");
416+
typeParam = typeParam.replace(/\*/g, ".*");
417417

418418
// Check if the element has a FileList before checking each file
419419
if (element.files && element.files.length) {

0 commit comments

Comments
 (0)