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.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]