From 71c31dfd665da1e2c14edb5ad99a6ef083baee01 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 20 Dec 2019 17:09:33 +0800 Subject: [PATCH] =?UTF-8?q?HTML=E8=BF=87=E6=BB=A4=E5=99=A8=E4=B8=8D?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E5=8F=8C=E5=BC=95=E5=8F=B7=E4=B8=BA"?= =?UTF-8?q?=EF=BC=8C=E9=98=B2=E6=AD=A2json=E6=A0=BC=E5=BC=8F=E6=97=A0?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java b/ruoyi/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java index e99e487..6244cd5 100644 --- a/ruoyi/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java +++ b/ruoyi/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java @@ -522,7 +522,8 @@ public final class HTMLFilter final String one = m.group(1); // (>|^) final String two = m.group(2); // ([^<]+?) final String three = m.group(3); // (<|$) - m.appendReplacement(buf, Matcher.quoteReplacement(one + regexReplace(P_QUOTE, """, two) + three)); + // 不替换双引号为",防止json格式无效 regexReplace(P_QUOTE, """, two) + m.appendReplacement(buf, Matcher.quoteReplacement(one + two + three)); } m.appendTail(buf); return buf.toString();