Skip to content

Commit

Permalink
feat: apply code review
Browse files Browse the repository at this point in the history
  • Loading branch information
seonim-ryu committed Jun 3, 2020
1 parent 4a68b06 commit 91f8421
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/editor/src/js/htmlSanitizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function removeUnnecessaryTags(html) {
* @param {boolean} state
* @private
*/
function isXSSValueWithAttribute(attrName, attrValue) {
function isXSSAttribute(attrName, attrValue) {
return attrName.match(XSS_ATTR_RX) && attrValue.match(XSS_VALUE_RX);
}

Expand Down Expand Up @@ -117,9 +117,9 @@ function leaveOnlyWhitelistAttribute(html) {
const { name, value } = attr;
const htmlAttr = name.match(HTML_ATTR_LIST_RX);
const svgAttr = name.match(SVG_ATTR_LIST_RX);
const xssValueWithAttr = htmlAttr && isXSSValueWithAttribute(name, value);
const xssAttr = htmlAttr && isXSSAttribute(name, value);

return (!htmlAttr && !svgAttr) || xssValueWithAttr;
return (!htmlAttr && !svgAttr) || xssAttr;
});

removeBlacklistAttributes(attributes, blacklist);
Expand Down

0 comments on commit 91f8421

Please sign in to comment.