aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2020-05-09 16:50:47 +0300
committerXhmikosR <[email protected]>2020-05-12 19:21:36 +0300
commit86f2c014592dfacdceef70ed05070b2548f74805 (patch)
tree398254007fcad264075441781bd455e073c3e3f9 /js/src
parent955c437f32a3d83da5840b5fee29a7c606474c99 (diff)
downloadbootstrap-86f2c014592dfacdceef70ed05070b2548f74805.tar.xz
bootstrap-86f2c014592dfacdceef70ed05070b2548f74805.zip
Partially revert "Use regex.test() when we want to check for a Boolean. (#29969)"
This partially reverts commit 6c464938039e4fb23af4a35146250da9e1630de4.
Diffstat (limited to 'js/src')
-rw-r--r--js/src/tools/sanitizer.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/js/src/tools/sanitizer.js b/js/src/tools/sanitizer.js
index 0c3d4813b..4ff3f7aa6 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 SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue)
+ return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN))
}
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 (regExp[i].test(attrName)) {
+ if (attrName.match(regExp[i])) {
return true
}
}