We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 177fbe3 commit ecca771Copy full SHA for ecca771
src/assets/netteForms.js
@@ -449,8 +449,24 @@
449
},
450
451
pattern: function(elem, arg, val) {
452
+ if (typeof arg !== 'string') {
453
+ return null;
454
+ }
455
+
456
try {
- return typeof arg === 'string' ? (new RegExp('^(?:' + arg + ')$')).test(val) : null;
457
+ var regExp = new RegExp('^(?:' + arg + ')$');
458
459
+ if (window.FileList && val instanceof FileList) {
460
+ for (var i = 0; i < val.length; i++) {
461
+ if (!regExp.test(val[i].name)) {
462
+ return false;
463
464
465
466
+ return true;
467
468
469
+ return regExp.test(val);
470
} catch (e) {} // eslint-disable-line no-empty
471
472
0 commit comments