Remove erroneous backslashes before already-escaped < entries in vnd.mif mime magic, plus unit tests. Thanks to Steffen Netz in TIKA-1898 for help with this
Project: http://git-wip-us.apache.org/repos/asf/tika/repo Commit: http://git-wip-us.apache.org/repos/asf/tika/commit/c94236a8 Tree: http://git-wip-us.apache.org/repos/asf/tika/tree/c94236a8 Diff: http://git-wip-us.apache.org/repos/asf/tika/diff/c94236a8 Branch: refs/heads/master Commit: c94236a8365b9ab1491d98c31819a85b065a9fe1 Parents: 959c9ad Author: Nick Burch <n...@gagravarr.org> Authored: Wed Mar 23 23:31:12 2016 +0000 Committer: Nick Burch <n...@gagravarr.org> Committed: Wed Mar 23 23:31:12 2016 +0000 ---------------------------------------------------------------------- .../org/apache/tika/mime/tika-mimetypes.xml | 15 +++++++-------- .../java/org/apache/tika/mime/TestMimeTypes.java | 6 ++++++ 2 files changed, 13 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tika/blob/c94236a8/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml ---------------------------------------------------------------------- diff --git a/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml b/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml index ac3b634..979e0ac 100644 --- a/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml +++ b/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml @@ -1449,14 +1449,13 @@ <alias type="application/x-mif"/> <alias type="application/x-frame"/> <magic priority="50"> - <match value="\<MakerFile" type="string" offset="0" /> - <match value="\<MIFFile" type="string" offset="0" /> - <match value="\<MakerDictionary" type="string" offset="0" /> - <match value="\<MakerScreenFont" type="string" offset="0" /> - <match value="\<MML" type="string" offset="0" /> - <match value="\<Book" type="string" offset="0" /> - <match value="\<Maker" type="string" offset="0" /> - <match value="\x3c\x4d\x49\x46\x46\x69\x6c\x65\x20" type="string" offset="0" /> + <match value="<MakerFile" type="string" offset="0" /> + <match value="<MIFFile" type="string" offset="0" /> + <match value="<MakerDictionary" type="string" offset="0" /> + <match value="<MakerScreenFont" type="string" offset="0" /> + <match value="<MML" type="string" offset="0" /> + <match value="<Book" type="string" offset="0" /> + <match value="<Maker" type="string" offset="0" /> </magic> <glob pattern="*.mif"/> </mime-type> http://git-wip-us.apache.org/repos/asf/tika/blob/c94236a8/tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java ---------------------------------------------------------------------- diff --git a/tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java b/tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java index 57198ad..ce597fa 100644 --- a/tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java +++ b/tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java @@ -1001,6 +1001,12 @@ public class TestMimeTypes { } @Test + public void testMIF() throws Exception { + assertType("application/vnd.mif", "testMIF.mif"); + assertTypeByData("application/vnd.mif", "testMIF.mif"); + } + + @Test public void testPKCSSignatures() throws Exception { // PKCS7 Signed XML files assertType("application/pkcs7-signature", "testPKCS17Sig.xml.p7m");