mirror of
https://github.com/Alvin-Zilverstand/Twitter-X-Media-Batch-Downloader.git
synced 2026-12-01 18:41:24 +01:00
v4.6
This commit is contained in:
1 parent
33be717065
commit
e05a9379fc
20 files changed
+1449
-611
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user