Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/src/util/sanitizer.js11
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 = {