bugfix: 修复zip的slip问题,防止上传恶意zip,增强服务器安全性。

This commit is contained in:
Go-Go-Farther
2022-06-20 13:54:53 +08:00
parent edc96294e6
commit 940cc2420c
2 changed files with 24 additions and 5 deletions

View File

@@ -699,6 +699,8 @@ func (book *Book) ImportBook(zipPath string, lang string) error {
}
//如果加压缩失败
if err := ziptil.Unzip(zipPath, tempPath); err != nil {
logs.Error("CAll ziptil.Unzip error, zipPath: %s, tempPath: %s, err: %v",
zipPath, tempPath, err)
return err
}
//当导入结束后,删除临时文件