MDL-68356 core_h5p: Fix h5p mimetype
Add a correct mime type for h5p files and update existing mime type for stored h5p files.
This commit is contained in:
@@ -114,7 +114,7 @@ abstract class core_filetypes {
|
||||
'gzip' => array('type' => 'application/g-zip', 'icon' => 'archive',
|
||||
'groups' => array('archive'), 'string' => 'archive'),
|
||||
'h' => array('type' => 'text/plain', 'icon' => 'sourcecode'),
|
||||
'h5p' => array('type' => 'application/zip', 'icon' => 'h5p', 'string' => 'archive'),
|
||||
'h5p' => array('type' => 'application/zip.h5p', 'icon' => 'h5p', 'string' => 'archive'),
|
||||
'hpp' => array('type' => 'text/plain', 'icon' => 'sourcecode'),
|
||||
'hqx' => array('type' => 'application/mac-binhex40', 'icon' => 'archive',
|
||||
'groups' => array('archive'), 'string' => 'archive'),
|
||||
|
||||
@@ -3859,5 +3859,19 @@ function xmldb_main_upgrade($oldversion) {
|
||||
upgrade_main_savepoint(true, 2019111802.05);
|
||||
}
|
||||
|
||||
if ($oldversion < 2019111802.08) {
|
||||
// Upgrade h5p MIME type for existing h5p files.
|
||||
$select = $DB->sql_like('filename', '?', false);
|
||||
$DB->set_field_select(
|
||||
'files',
|
||||
'mimetype',
|
||||
'application/zip.h5p',
|
||||
$select,
|
||||
array('%.h5p')
|
||||
);
|
||||
|
||||
upgrade_main_savepoint(true, 2019111802.08);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2019111802.07; // 20191118 = branching date YYYYMMDD - do not modify!
|
||||
$version = 2019111802.08; // 20191118 = branching date YYYYMMDD - do not modify!
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
$release = '3.8.2+ (Build: 20200417)'; // Human-friendly version name
|
||||
|
||||
Reference in New Issue
Block a user