Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
b07b3420
Unverified
Commit
b07b3420
authored
4 years ago
by
XhmikosR
Committed by
GitHub
4 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Partially Revert "Use regex.test() when we want to check for a Boolean. (#29969)" (#30770)
This partially reverts commit
9c2b9ac7
.
parent
97eb2c1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/src/util/sanitizer.js
+2
-2
js/src/util/sanitizer.js
with
2 additions
and
2 deletions
+2
-2
js/src/util/sanitizer.js
+
2
-
2
View file @
b07b3420
...
@@ -37,7 +37,7 @@ const allowedAttribute = (attr, allowedAttributeList) => {
...
@@ -37,7 +37,7 @@ const allowedAttribute = (attr, allowedAttributeList) => {
if
(
allowedAttributeList
.
indexOf
(
attrName
)
!==
-
1
)
{
if
(
allowedAttributeList
.
indexOf
(
attrName
)
!==
-
1
)
{
if
(
uriAttrs
.
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
return
true
...
@@ -47,7 +47,7 @@ const allowedAttribute = (attr, allowedAttributeList) => {
...
@@ -47,7 +47,7 @@ const allowedAttribute = (attr, allowedAttributeList) => {
// Check if a regular expression validates the attribute.
// Check if a regular expression validates the attribute.
for
(
let
i
=
0
,
len
=
regExp
.
length
;
i
<
len
;
i
++
)
{
for
(
let
i
=
0
,
len
=
regExp
.
length
;
i
<
len
;
i
++
)
{
if
(
regExp
[
i
].
test
(
attrName
))
{
if
(
attrName
.
match
(
regExp
[
i
]
))
{
return
true
return
true
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment