Skip to content

Commit

Permalink
MDL-38468 Files API: fixed the support for MTHML (MIME HTML: web page…
Browse files Browse the repository at this point in the history
… archive) files
  • Loading branch information
scara committed Mar 23, 2013
1 parent b9ef2c9 commit 9992ee7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
16 changes: 16 additions & 0 deletions lib/db/upgrade.php
Expand Up @@ -1671,5 +1671,21 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2012120302.01);
}

if ($oldversion < 2012120303.02) {
// Fixing possible wrong MIME type for MIME HTML (MHTML) files.
$extensions = array('%.mht', '%.mhtml');
$select = $DB->sql_like('filename', '?', false);
foreach ($extensions as $extension) {
$DB->set_field_select(
'files',
'mimetype',
'message/rfc822',
$select,
array($extension)
);
}
upgrade_main_savepoint(true, 2012120303.02);
}

return true;
}
2 changes: 2 additions & 0 deletions lib/filelib.php
Expand Up @@ -1500,6 +1500,8 @@ function &get_mimetypes_array() {
'mp4' => array ('type'=>'video/mp4', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'),
'm4v' => array ('type'=>'video/mp4', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'),
'm4a' => array ('type'=>'audio/mp4', 'icon'=>'mp3', 'groups'=>array('audio'), 'string'=>'audio'),
'mht' => array ('type'=>'message/rfc822', 'icon'=>'archive'),
'mhtml'=> array ('type'=>'message/rfc822', 'icon'=>'archive'),
'mpeg' => array ('type'=>'video/mpeg', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'),
'mpe' => array ('type'=>'video/mpeg', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'),
'mpg' => array ('type'=>'video/mpeg', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'),
Expand Down
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();


$version = 2012120303.01; // 20121203 = branching date YYYYMMDD - do not modify!
$version = 2012120303.02; // 20121203 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches
// .XX = incremental changes

Expand Down

0 comments on commit 9992ee7

Please sign in to comment.