fix(epub): handle duplicate zip entries when extracting epubs (#2526)

This commit is contained in:
James Ward
2026-09-07 16:46:50 -04:00
committed by GitHub
parent 1ee9b51444
commit 75495bf5ff
2 changed files with 75 additions and 1 deletions
@@ -538,6 +538,12 @@ public class EpubMetadataWriter implements MetadataWriter {
if (!entryPath.startsWith(targetDir)) {
throw new IOException("ZIP entry outside target directory: " + name);
}
if (Files.exists(entryPath)) {
log.warn("EPUB Entry already exists, skipping: {}", entryPath);
continue;
}
Files.createDirectories(entryPath.getParent());
archiveService.extractEntryToPath(zipPath, name, entryPath);
}