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

       Web browser: ---
             Bug #: 33515
           Summary: .odb file recognized as application/acad
           Product: MediaWiki
           Version: 1.19-svn
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Uploading
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


Created attachment 9803
  --> https://bugzilla.wikimedia.org/attachment.cgi?id=9803
fresh OpenDocument database

When uploading on opendocument database, it is recognized as application/acad
type.

finfo does not recognize the type using magic.mime which return
application/octet-stream. MediaWiki thus tries to guess the file content
according to its extension. With upload stash, the temporary file does not have
any file extension (the path is something like
'mwrepo://local/temp/4/46/20120104160114!phpFfHK5z.'), hence the detection
gives unknown/unknown and then default to application/acad (the first one in
our list).

The attached file is an empty opendocument database file. Analyzing it with
File::getPropsFromPath() yield :

Array
(
    [fileExists] => 1
    [mime] => application/vnd.oasis.opendocument.database
    [media_type] => OFFICE
    [metadata] => 
    [sha1] => 5tlzupz0ww3q8w9pkowrdq72g0wnsqa
    [width] => 0
    [height] => 0
    [bits] => 0
    [file-mime] => unknown/unknown
    [minor_mime] => vnd.oasis.opendocument.database
    [major_mime] => application
    [size] => 2498
)

Please note how 'mime' is correct but 'file-mime' is incorrect :-(

-- 
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