[fixed]:解决路径判断的错误 #1304

This commit is contained in:
奇淼(piexlmax
2022-12-08 19:13:31 +08:00
parent 01d1e4c7f5
commit 0627359b6e
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ func Unzip(zipFile string, destDir string) ([]string, error) {
defer zipReader.Close()
for _, f := range zipReader.File {
if strings.Index(f.Name, "../") > -1 {
if strings.Index(f.Name, "..") > -1 {
return []string{}, fmt.Errorf("%s 文件名不合法", f.Name)
}
fpath := filepath.Join(destDir, f.Name)