Commit 71c31dfd665da1e2c14edb5ad99a6ef083baee01

Authored by RuoYi
1 parent 8bc7296f

HTML过滤器不替换双引号为",防止json格式无效

ruoyi/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java
@@ -522,7 +522,8 @@ public final class HTMLFilter @@ -522,7 +522,8 @@ public final class HTMLFilter
522 final String one = m.group(1); // (>|^) 522 final String one = m.group(1); // (>|^)
523 final String two = m.group(2); // ([^<]+?) 523 final String two = m.group(2); // ([^<]+?)
524 final String three = m.group(3); // (<|$) 524 final String three = m.group(3); // (<|$)
525 - m.appendReplacement(buf, Matcher.quoteReplacement(one + regexReplace(P_QUOTE, "&quot;", two) + three)); 525 + // 不替换双引号为&quot;,防止json格式无效 regexReplace(P_QUOTE, "&quot;", two)
  526 + m.appendReplacement(buf, Matcher.quoteReplacement(one + two + three));
526 } 527 }
527 m.appendTail(buf); 528 m.appendTail(buf);
528 return buf.toString(); 529 return buf.toString();