提交 5b6cc0bb 编写于 作者: O o2sword 提交者: 程剑

资源文件上传时限制名称带斜杠


(cherry picked from commit 51ac38d6)
上级 27ced908
......@@ -49,7 +49,7 @@ public class ActionSave extends BaseAction {
throw new ExceptionNameEmpty();
}
if(fileName.indexOf("/") > -1){
throw new Exception("名称不能包含'/'!");
throw new IllegalAccessException("名称不能包含'/'!");
}
String data = wi.getFileContent();
......
......@@ -24,6 +24,9 @@ class ActionDispatchResource extends BaseAction {
if (StringUtils.isEmpty(fileName)) {
fileName = this.fileName(disposition);
}
if (fileName.indexOf("/") > -1) {
throw new IllegalAccessException("名称不能包含'/'!");
}
if(!fileName.toLowerCase().endsWith(".zip") && StringUtils.isEmpty(filePath)){
throw new Exception("非zip文件的filePath属性不能为空");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册