mirror of
https://github.com/Hopiu/bootstrap.git
synced 2026-03-30 11:10:23 +00:00
util/sanitizer.js: use Array.every() (#35120)
This commit is contained in:
parent
598b4c59a6
commit
2596c97034
1 changed files with 2 additions and 9 deletions
|
|
@ -43,16 +43,9 @@ const allowedAttribute = (attribute, allowedAttributeList) => {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp)
|
|
||||||
|
|
||||||
// Check if a regular expression validates the attribute.
|
// Check if a regular expression validates the attribute.
|
||||||
for (const element of regExp) {
|
return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp)
|
||||||
if (element.test(attributeName)) {
|
.every(regex => regex.test(attributeName))
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DefaultAllowlist = {
|
export const DefaultAllowlist = {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue