Permalink
Browse files

MDL-38468 Files API: fixed the support for MTHML (MIME HTML: web page…

… archive) files

Conflicts:

	version.php
  • Loading branch information...
scara authored and damyon committed Mar 14, 2013
1 parent 7e53f1a commit 4c1689ba523117dc2224d2b5c30684125516c1fc
Showing with 19 additions and 1 deletion.
  1. +16 −0 lib/db/upgrade.php
  2. +2 −0 lib/filelib.php
  3. +1 −1 version.php
View
@@ -1126,5 +1126,21 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2012062504.13);
}
+ 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;
}
View
@@ -1452,6 +1452,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'),
View
@@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2012062506.01; // YYYYMMDD = weekly release date of this DEV branch
+$version = 2012062506.02; // YYYYMMDD = weekly release date of this DEV branch
// RR = release increments - 00 in DEV branches
// .XX = incremental changes

0 comments on commit 4c1689b

Please sign in to comment.