File import of zipped PDF does not detect filetype correctly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Robert Lyon | ||
1.7 |
Fix Released
|
Medium
|
Robert Lyon | ||
1.8 |
Fix Released
|
Medium
|
Robert Lyon | ||
1.9 |
Fix Released
|
Medium
|
Robert Lyon |
Bug Description
In Mahara 1.9.0
After building a portfolio export button for the Moodle certificate module using MNet, I found that the PDF file was getting saved with the mimetype set to application/
In import/
$data->guess = file_mime_
And then file_mime_type() fails because it doesn't know what the extension is.
To fix it, the following chunk of code works nicely:
if (isset(
} else {
}
This causes the original filename to be read from the file object.
Changed in mahara: | |
milestone: | none → 1.10.0 |
assignee: | nobody → Robert Lyon (robertl-9) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in mahara: | |
status: | In Progress → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → In Progress |
Changed in mahara: | |
status: | In Progress → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
Patch for "master" branch: https:/ /reviews. mahara. org/3384