RuoYi
2019-12-20 71c31dfd665da1e2c14edb5ad99a6ef083baee01
HTML过滤器不替换双引号为",防止json格式无效
已修改1个文件
3 ■■■■ 文件已修改
ruoyi/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java
@@ -522,7 +522,8 @@
                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, "&quot;", two) + three));
                // 不替换双引号为&quot;,防止json格式无效 regexReplace(P_QUOTE, "&quot;", two)
                m.appendReplacement(buf, Matcher.quoteReplacement(one + two + three));
            }
            m.appendTail(buf);
            return buf.toString();