mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-15 11:59:39 +03:00
util/sanitizer.js: use Array.every() (#35120)
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user