aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2021-01-27 18:37:18 +0200
committerGitHub <[email protected]>2021-01-27 18:37:18 +0200
commit17d8fba548909db2ce358ddfeaaab292cacc0874 (patch)
tree65983905058ba6f91952fbe0e5947cfbf3fdff4e /js/src
parent6ffb0b48e455430f8a5359ed689ad64c1143fac2 (diff)
downloadbootstrap-17d8fba548909db2ce358ddfeaaab292cacc0874.tar.xz
bootstrap-17d8fba548909db2ce358ddfeaaab292cacc0874.zip
Update devDependencies (#32852)
Pin karma and linkinator due to failures
Diffstat (limited to 'js/src')
-rw-r--r--js/src/tools/sanitizer.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/js/src/tools/sanitizer.js b/js/src/tools/sanitizer.js
index 45fd6106c..3878a4365 100644
--- a/js/src/tools/sanitizer.js
+++ b/js/src/tools/sanitizer.js
@@ -71,7 +71,7 @@ function allowedAttribute(attr, allowedAttributeList) {
if (allowedAttributeList.indexOf(attrName) !== -1) {
if (uriAttrs.indexOf(attrName) !== -1) {
- return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN))
+ return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue))
}
return true
@@ -81,7 +81,7 @@ function allowedAttribute(attr, allowedAttributeList) {
// Check if a regular expression validates the attribute.
for (let i = 0, len = regExp.length; i < len; i++) {
- if (attrName.match(regExp[i])) {
+ if (regExp[i].test(attrName)) {
return true
}
}
@@ -114,6 +114,7 @@ export function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
}
const attributeList = [].slice.call(el.attributes)
+ // eslint-disable-next-line unicorn/prefer-spread
const whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])
attributeList.forEach(attr => {