diff --git a/server/src/main/java/cn/keking/utils/KkFileUtils.java b/server/src/main/java/cn/keking/utils/KkFileUtils.java index b4785565..2ef6aedb 100644 --- a/server/src/main/java/cn/keking/utils/KkFileUtils.java +++ b/server/src/main/java/cn/keking/utils/KkFileUtils.java @@ -104,7 +104,9 @@ public class KkFileUtils { public static String htmlEscape(String input) { if(StringUtils.hasText(input)){ //input = input.replaceAll("\\{", "%7B").replaceAll("}", "%7D").replaceAll("\\\\", "%5C"); - return HtmlUtils.htmlEscape(input, "UTF-8"); + String htmlStr = HtmlUtils.htmlEscape(input, "UTF-8"); + //& -> & + return htmlStr.replace("&", "&"); } return input; }