0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-18 10:52:19 +01:00

Partially revert "Use regex.test() when we want to check for a Boolean. (#29969)"

This partially reverts commit 6c464938039e4fb23af4a35146250da9e1630de4.
This commit is contained in:
XhmikosR 2020-05-09 16:50:47 +03:00
parent 955c437f32
commit 86f2c01459

View File

@ -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
}
}