From a8b31dae8ac732668205c20e3de7a5f7b5529be6 Mon Sep 17 00:00:00 2001 From: Arne <1169654+arnef@users.noreply.github.com> Date: Sat, 8 Aug 2026 13:40:53 +0200 Subject: [PATCH] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- internal/library/library.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/library/library.go b/internal/library/library.go index 323c10e..b42fc07 100644 --- a/internal/library/library.go +++ b/internal/library/library.go @@ -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