diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2015-04-14 20:52:21 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2015-04-15 17:48:45 +0200 |
commit | d940388d7747fd3d816fbd7813567a843d30d969 (patch) | |
tree | 89bff949eda3500760f2bb37903865639e4919ad /source/html | |
parent | fefb4d2248d4d4ef65106ef4ed48f904fa2066d9 (diff) | |
download | mupdf-d940388d7747fd3d816fbd7813567a843d30d969.tar.xz |
epub: Check version number and warn if it's not an EPUB 2.0 file.
Diffstat (limited to 'source/html')
-rw-r--r-- | source/html/epub-doc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/html/epub-doc.c b/source/html/epub-doc.c index bd550e3d..2ea9f298 100644 --- a/source/html/epub-doc.c +++ b/source/html/epub-doc.c @@ -199,6 +199,7 @@ epub_parse_header(fz_context *ctx, epub_document *doc) fz_xml *package, *manifest, *spine, *itemref; char base_uri[2048]; const char *full_path; + const char *version; char ncx[2048], s[2048]; epub_chapter *head, *tail; @@ -228,6 +229,10 @@ epub_parse_header(fz_context *ctx, epub_document *doc) fz_drop_buffer(ctx, buf); package = fz_xml_find(content_opf, "package"); + version = fz_xml_att(package, "version"); + if (!version || strcmp(version, "2.0")) + fz_warn(ctx, "unknown epub version: %s", version ? version : "<none>"); + manifest = fz_xml_find_down(package, "manifest"); spine = fz_xml_find_down(package, "spine"); |