badmfck-api-server 2.0.6 → 2.0.8
Sign up to get free protection for your applications and to get access to all the features.
@@ -90,7 +90,8 @@ class Validator {
|
|
90
90
|
opt.regex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,6}$/g;
|
91
91
|
}
|
92
92
|
if (opt.regex) {
|
93
|
-
const
|
93
|
+
const globalRegex = new RegExp(opt.regex.source, opt.regex.flags.includes('g') ? opt.regex.flags : opt.regex.flags + 'g');
|
94
|
+
const tmp = value.replaceAll(globalRegex, "");
|
94
95
|
if (tmp.length !== 0)
|
95
96
|
return ValidationReport.VALUE_INCORRECT;
|
96
97
|
}
|