Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Arne
2026-08-08 13:40:53 +02:00
committed by GitHub
co-authored by Copilot Autofix powered by AI
parent 1f31d7afae
commit a8b31dae8a
+5 -1
View File
@@ -286,8 +286,12 @@ func findEPUBCoverPath(rootPath string, pkg packageXML) string {
}
func cleanEPUBPath(rootPath, href string) string {
href = strings.TrimSpace(href)
if href == "" || strings.HasPrefix(href, "/") {
return ""
}
joined := path.Clean(path.Join(rootPath, href))
if strings.HasPrefix(joined, "../") {
if joined == "." || strings.HasPrefix(joined, "../") || strings.HasPrefix(joined, "/") {
return ""
}
return joined