Partially revert "Use regex.test() when we want to check for a Boolean. (#29969)"
This partially reverts commit 6c46493803.
This commit is contained in:
parent
955c437f32
commit
86f2c01459
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue