This commit is contained in:
429Enjoyer committed 2026-05-19 14:28:05 +07:00
1 parent 33be717065
commit e05a9379fc
20 files changed
+1449 -611

No files matched your search

+12
View File
@@ -469,6 +469,10 @@ func extractExifToolFromZip(zipPath, destPath string) error {
}
libDir := filepath.Join(filepath.Dir(destPath), "exiftool_files")
libDirAbs, err := filepath.Abs(libDir)
if err != nil {
return fmt.Errorf("failed to resolve libDir: %v", err)
}
for _, f := range r.File {
if strings.Contains(f.Name, "exiftool_files") && !strings.HasSuffix(f.Name, "/") {
parts := strings.Split(f.Name, "exiftool_files/")
@@ -482,6 +486,14 @@ func extractExifToolFromZip(zipPath, destPath string) error {
targetPath := filepath.Join(libDir, relPath)
targetAbs, err := filepath.Abs(targetPath)
if err != nil {
continue
}
if !strings.HasPrefix(targetAbs+string(os.PathSeparator), libDirAbs+string(os.PathSeparator)) && targetAbs != libDirAbs {
continue
}
if err := os.MkdirAll(filepath.Dir(targetPath), 0755); err != nil {
continue
}