https://bugzilla.wikimedia.org/show_bug.cgi?id=23642

           Summary: mime of some xls files are incorrectly detect as
                    application/zip
           Product: MediaWiki
           Version: 1.14.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: Uploading
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


According to, includes/MimeMagic.php

                // Check for ZIP (before getimagesize)
                if ( strpos( $tail, "PK\x05\x06" ) !== false ) {
                        wfDebug( __METHOD__.": ZIP header present at end of
$file\n" );
                        return $this->detectZipType( $head );
                } 

Some xls (ms excel) files contain "PK\x05\x06", so it incorrectly detect as zip
file and not pass filetype checking.


Here is the debugging message shown by $wgDebugComments=true,

   mime: <application/zip> extension: <xls>

   UploadForm::verifyExtension: mime type application/zip mismatches file
extension xls, rejecting file

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to