diff options
Diffstat (limited to 'js/src/util/sanitizer.js')
-rw-r--r-- | js/src/util/sanitizer.js | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/js/src/util/sanitizer.js b/js/src/util/sanitizer.js index e27961e9a3..f5a8287cd0 100644 --- a/js/src/util/sanitizer.js +++ b/js/src/util/sanitizer.js @@ -43,16 +43,9 @@ const allowedAttribute = (attribute, allowedAttributeList) => { return true } - const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp) - // Check if a regular expression validates the attribute. - for (const element of regExp) { - if (element.test(attributeName)) { - return true - } - } - - return false + return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp) + .every(regex => regex.test(attributeName)) } export const DefaultAllowlist = { |