fix(bug): 修复本地存储可以通过特殊路径符获取任意目录的 BUG.

This commit is contained in:
zhaojun
2022-04-02 18:24:49 +08:00
parent 60a6a5348c
commit 168b0b08f3

View File

@@ -74,7 +74,7 @@ public class LocalServiceImpl extends AbstractBaseFileService implements BaseFil
@Override
public List<FileItemDTO> fileList(String path) throws FileNotFoundException {
if (StrUtil.startWith(path, "..")) {
if (StrUtil.startWith(path, "..") || StrUtil.startWith(path, "/..")) {
return Collections.emptyList();
}
List<FileItemDTO> fileItemList = new ArrayList<>();