From 8abdcfd3c1cc410d705cb7df07bdfc9203af99ac Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 12 Jul 2016 13:04:10 +0200 Subject: xps: Only recognize /_rels/.rels type paths, not any .rels file. --- source/xps/xps-doc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/xps/xps-doc.c') diff --git a/source/xps/xps-doc.c b/source/xps/xps-doc.c index fb4511f4..b796b922 100644 --- a/source/xps/xps-doc.c +++ b/source/xps/xps-doc.c @@ -470,15 +470,16 @@ xps_recognize(fz_context *ctx, const char *magic) if (ext) { - if (!fz_strcasecmp(ext, ".xps") || !fz_strcasecmp(ext, ".rels") || !fz_strcasecmp(ext, ".oxps")) + if (!fz_strcasecmp(ext, ".xps") || !fz_strcasecmp(ext, ".oxps")) return 100; } + if (strstr(magic, "/_rels/.rels") || strstr(magic, "\\_rels\\.rels")) + return 100; if (!strcmp(magic, "xps") || !strcmp(magic, "oxps") || !strcmp(magic, "application/vnd.ms-xpsdocument") || !strcmp(magic, "application/xps") || !strcmp(magic, "application/oxps")) return 100; - return 0; } -- cgit v1.2.3