Yuki Takei 7 年 前
コミット
c461a6112b
1 ファイル変更4 行追加10 行削除
  1. 4 10
      lib/util/xss.js

+ 4 - 10
lib/util/xss.js

@@ -3,7 +3,6 @@ class Xss {
   constructor(xssOption) {
     const xss = require('xss');
 
-    const isEnabledXssPrevention = xssOption.isEnabledXssPrevention;
     const tagWhiteList = xssOption.tagWhiteList;
     const attrWhiteList = xssOption.attrWhiteList;
 
@@ -12,20 +11,15 @@ class Xss {
     // default
     let option = {
       stripIgnoreTag: true,
-      stripIgnoreTagBody: false,
+      stripIgnoreTagBody: false,    // see https://github.com/weseek/growi/pull/505
       css: false,
       whiteList: whiteListContent,
       escapeHtml: (html) => html,   // resolve https://github.com/weseek/growi/issues/221
     };
 
-    if (isEnabledXssPrevention) {
-      tagWhiteList.forEach(tag => {
-        whiteListContent[tag] = attrWhiteList;
-      });
-    }
-    else {
-      option['stripIgnoreTag'] = false;
-    }
+    tagWhiteList.forEach(tag => {
+      whiteListContent[tag] = attrWhiteList;
+    });
 
     // create the XSS Filter instance
     this.myxss = new xss.FilterXSS(option);