[
https://issues.apache.org/jira/browse/TIKA-5050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18139111#comment-18139111
]
ASF GitHub Bot commented on TIKA-5050:
--------------------------------------
tballison commented on PR #3546:
URL: https://github.com/apache/tika/pull/3546#issuecomment-6666050074
Bot nits:
```
1. The base entry name is parsed as a URI, but it is a literal zip entry
name (ZipEntryPaths.java, uri(base)). The javadoc
says from is "the name of the entry". But new URI("/" + from) succeeds
on names containing %XX, # or ?, and then
interprets them. I checked this by running the method's logic:
- My%20Book/content.opf + Text/ch1.xhtml → My Book/Text/ch1.xhtml
(entry not found)
- OEBPS#1/content.opf + Text/ch1.xhtml → Text/ch1.xhtml
- a?b/content.opf + ch1.xhtml → ch1.xhtml
The old code concatenated strings, so these packages used to work. This
is a regression, rare but silent: every chapter
gets skipped. Fix: always build the base with new URI(null, null, base,
null) and add a test for a literal %20 in from.
The current "My Book" test only exercises the fallback path.
2. An href that is only a fragment or empty resolves to the OPF itself or
its folder. #frag → OEBPS/content.opf, which then
gets parsed as a spine chapter (the media-type check passes if the href
is declared html). "" → OEBPS/. Fix: return
null when the reference's raw path is empty.
```
> EpubParser misses manifest items whose href holds a '+' or a '../'
> ------------------------------------------------------------------
>
> Key: TIKA-5050
> URL: https://issues.apache.org/jira/browse/TIKA-5050
> Project: Tika
> Issue Type: Bug
> Components: parser
> Reporter: Dominik Schmidt
> Priority: Major
>
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)