mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-28 14:29:07 +02:00
Comply to the new rules.
This commit is contained in:
@@ -47,7 +47,7 @@ const allowedAttribute = (attr, allowedAttributeList) => {
|
||||
return true
|
||||
}
|
||||
|
||||
const regExp = allowedAttributeList.filter((attrRegex) => attrRegex instanceof RegExp)
|
||||
const regExp = allowedAttributeList.filter(attrRegex => attrRegex instanceof RegExp)
|
||||
|
||||
// Check if a regular expression validates the attribute.
|
||||
for (let i = 0, l = regExp.length; i < l; i++) {
|
||||
@@ -120,7 +120,7 @@ export function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
|
||||
const attributeList = makeArray(el.attributes)
|
||||
const whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])
|
||||
|
||||
attributeList.forEach((attr) => {
|
||||
attributeList.forEach(attr => {
|
||||
if (!allowedAttribute(attr, whitelistedAttributes)) {
|
||||
el.removeAttribute(attr.nodeName)
|
||||
}
|
||||
|
Reference in New Issue
Block a user