!86 预览图片的url中如果包含&会导致.click报错儿

Merge pull request !86 from ASelince丶C/N/A
pull/116/MERGE
kailing 2023-04-24 08:02:02 +00:00 committed by Gitee
commit f593b0cf24
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 3 additions and 1 deletions

View File

@ -104,7 +104,9 @@ public class KkFileUtils {
public static String htmlEscape(String input) { public static String htmlEscape(String input) {
if(StringUtils.hasText(input)){ if(StringUtils.hasText(input)){
//input = input.replaceAll("\\{", "%7B").replaceAll("}", "%7D").replaceAll("\\\\", "%5C"); //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; return input;
} }