MS Office files being seen as zip archives
Bug #1302251 reported by
Aaron Wells
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Robert Lyon | ||
1.6 |
Fix Released
|
High
|
Robert Lyon | ||
1.7 |
Fix Released
|
High
|
Robert Lyon | ||
1.8 |
Fix Released
|
High
|
Robert Lyon | ||
1.9 |
Fix Released
|
High
|
Robert Lyon |
Bug Description
Now that we've got file_mime_type() working with the PHP fileinfo library correctly, it has caused a problem. Microsoft Office 2007+ "docx" files are recognized as zip archives by fileinfo!
So when users upload a .docx file into Mahara, they see a ZIP icon, and they have the option to decompress the archive. Which they should not.
Changed in mahara: | |
assignee: | nobody → Robert Lyon (robertl-9) |
Changed in mahara: | |
milestone: | 1.9.0 → 1.10.0 |
no longer affects: | mahara/trunk |
Changed in mahara: | |
status: | Confirmed → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
The current workaround is to disable fileinfo. You can do this by setting $cfg->pathtomagicdb to boolean false. However, if you've got the mime_content_type PHP library installed, it'll fall back to that as well, and that also identifies docx files as ZIP files. So what you have to do is apply an invalid pathtomagicdb value. This will cause Mahara to attempt to use fileinfo, fail, and fall back to identifying the filetype based on its file extension.
So to do that, you would put something like this in your config.php:
$cfg-> pathtomagicdb = '/dev/null';