Author: rgauss
Date: Tue Sep  3 18:46:26 2013
New Revision: 1519792

URL: http://svn.apache.org/r1519792
Log:
TIKA-1170: Insufficiently specific magic for binary image/cgm files
   - Fix for incorrect application of patch
   - Additional test and resource from Andrew Jackson for false positive cgm 
matches on malformed HTML files

Added:
    
tika/trunk/tika-core/src/test/resources/org/apache/tika/mime/test-malformed-header.html.bin
   (with props)
Modified:
    
tika/trunk/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
    
tika/trunk/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java

Modified: 
tika/trunk/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
URL: 
http://svn.apache.org/viewvc/tika/trunk/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml?rev=1519792&r1=1519791&r2=1519792&view=diff
==============================================================================
--- 
tika/trunk/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml 
(original)
+++ 
tika/trunk/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml 
Tue Sep  3 18:46:26 2013
@@ -3882,7 +3882,6 @@
     <_comment>Computer Graphics Metafile</_comment>
     <magic priority="50">
       <match value="BEGMF" type="string" offset="0"/>
-      <match value="0x0020" mask="0xffe0" type="string" offset="0"/>
       <match value="0x0020" mask="0xffe0" type="string" offset="0">
         <match value="0x10220001" type="string" offset="2:64"/>
         <match value="0x10220002" type="string" offset="2:64"/>

Modified: 
tika/trunk/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java
URL: 
http://svn.apache.org/viewvc/tika/trunk/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java?rev=1519792&r1=1519791&r2=1519792&view=diff
==============================================================================
--- 
tika/trunk/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java 
(original)
+++ 
tika/trunk/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java 
Tue Sep  3 18:46:26 2013
@@ -68,6 +68,8 @@ public class MimeDetectionTest extends T
         testFile("text/html", "htmlfragment");
         // test binary CGM detection (TIKA-1170)
         testFile("image/cgm", "plotutils-bin-cgm-v3.cgm");
+        // test HTML detection of malformed file, previously identified as 
image/cgm (TIKA-1170)
+        testFile("text/html", "test-malformed-header.html.bin");
     }
 
     public void testByteOrderMark() throws Exception {

Added: 
tika/trunk/tika-core/src/test/resources/org/apache/tika/mime/test-malformed-header.html.bin
URL: 
http://svn.apache.org/viewvc/tika/trunk/tika-core/src/test/resources/org/apache/tika/mime/test-malformed-header.html.bin?rev=1519792&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
tika/trunk/tika-core/src/test/resources/org/apache/tika/mime/test-malformed-header.html.bin
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream


Reply via email to