Commit 6c464938 authored by XhmikosR's avatar XhmikosR
Browse files

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

7 merge requests!36532My v4 dev,!34086v4: Fix prevented show event disables modals with fade class from being displayed again,!33729V4 dev,!33086V4 dev,!31901Add opacity utilities,!31513Update icons.md,!30331Removed 'shrink-to-fit' from `viewport` meta
Showing with 4 additions and 4 deletions
+4 -4
......@@ -18,7 +18,7 @@ childProcess.exec('java -version', (error, stdout, stderr) => {
return
}
const is32bitJava = !stderr.match(/64-Bit/)
const is32bitJava = !/64-Bit/.test(stderr)
// vnu-jar accepts multiple ignores joined with a `|`.
// Also note that the ignores are regular expressions.
......
......@@ -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 SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue)
}
return true
......@@ -80,8 +80,8 @@ function allowedAttribute(attr, allowedAttributeList) {
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++) {
if (attrName.match(regExp[i])) {
for (let i = 0, len = regExp.length; i < len; i++) {
if (regExp[i].test(attrName)) {
return true
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment