修正文件名中带有&字符错误问题

This commit is contained in:
imhao183
2020-06-08 21:43:12 +08:00
parent a73507c673
commit 28600ea7f9
@@ -109,7 +109,8 @@ public class FileAction extends Action {
}
// 路径安全检查
if (httpPath.contains("/.") || httpPath.contains("./") || httpPath.charAt(0) == '.' || httpPath.charAt(httpPath.length() - 1) == '.' || ReUtil.isMatch(INSECURE_URI, httpPath)) {
String path = httpPath.substring(0, httpPath.lastIndexOf("/"));
if (path.contains("/.") || path.contains("./") || path.charAt(0) == '.' || path.charAt(path.length() - 1) == '.' || ReUtil.isMatch(INSECURE_URI, path)) {
return null;
}