Skip to content

Commit

Permalink
fix file rename bug (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou9584 authored Nov 2, 2022
1 parent 4d02026 commit 6e0987e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ public File verifyAndSaveFile(@NotNull MultipartFile originFile, String parentDi
}

if (StringUtils.isEmpty(newFileName)) {
newFileName = FileUtil.getLegalFileName(newFileName);
newFileName = filename.replace(fileSuffix, "") + "_" + System.currentTimeMillis() % 10000 + "_" + fileSuffix;
}

newFileName = FileUtil.getLegalFileName(newFileName);
File file = new File(parentDir, newFileName);// CodeQL [java/path-injection] False Positive: Has verified the string by regular expression
InputStream inputStream = originFile.getInputStream();
if (isBase64) {
Expand Down

0 comments on commit 6e0987e

Please sign in to comment.