Dominik Schmidt created TIKA-5050:
-------------------------------------
Summary: 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
EpubParser decodes manifest hrefs with {{URLDecoder}}, which decodes HTML form
data, not URIs: a {{+}} becomes a space. It then appends the href to the OPF's
folder without resolving it, so a {{../}} is not followed.
An EPUB whose OPF sits in {{OEBPS/}} and whose spine names
{{Text/plain.xhtml}}, {{Text/c++.xhtml}} and {{../Shared/up.xhtml}} yields the
text of the first only; the other two are skipped without an exception or a
warning.
Manifest hrefs are URI references relative to the OPF (EPUB 3 Packages, 3.4.3).
Resolving them against the OPF's path (RFC 3986, section 5.2) and
percent-decoding the result as a URI path gives the zip entry name:
{{Text/c++%20b.xhtml}} is {{OEBPS/Text/c++ b.xhtml}}, {{../Images/cover.jpg}}
is {{Images/cover.jpg}}.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)