mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-10-08 00:14:26 +08:00
bugfix: 修复zip的slip问题,防止上传恶意zip,增强服务器安全性。
This commit is contained in:
@@ -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
|
||||
}
|
||||
//当导入结束后,删除临时文件
|
||||
|
Reference in New Issue
Block a user