Permalink
Browse files

MDL-40226 Files: Added the correct MIME Type for JNLP files.

JNLP stands for Java Network Launch Protocol, used to launch
Java Web Start applications. More details in:
http://docs.oracle.com/javase/tutorial/deployment/webstart/deploying.html
  • Loading branch information...
1 parent 9844660 commit f63fc5c41a5b3f93918949f0e3824eb15e1342e5 @scara scara committed Oct 6, 2013
Showing with 17 additions and 1 deletion.
  1. +15 −0 lib/db/upgrade.php
  2. +1 −0 lib/filelib.php
  3. +1 −1 version.php
View
15 lib/db/upgrade.php
@@ -1779,5 +1779,20 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2012120305.08);
}
+ if ($oldversion < 2012120306.05) {
+ // Fixing possible wrong MIME type for Java Network Launch Protocol (JNLP) files.
+ $select = $DB->sql_like('filename', '?', false);
+ $DB->set_field_select(
+ 'files',
+ 'mimetype',
+ 'application/x-java-jnlp-file',
+ $select,
+ array('%.jnlp')
+ );
+
+ // Main savepoint reached.
+ upgrade_main_savepoint(true, 2012120306.05);
+ }
+
return true;
}
View
1 lib/filelib.php
@@ -1478,6 +1478,7 @@ function &get_mimetypes_array() {
'jcw' => array ('type'=>'text/xml', 'icon'=>'markup'),
'jmt' => array ('type'=>'text/xml', 'icon'=>'markup'),
'jmx' => array ('type'=>'text/xml', 'icon'=>'markup'),
+ 'jnlp' => array ('type'=>'application/x-java-jnlp-file', 'icon'=>'markup'),
'jpe' => array ('type'=>'image/jpeg', 'icon'=>'jpeg', 'groups'=>array('image', 'web_image'), 'string'=>'image'),
'jpeg' => array ('type'=>'image/jpeg', 'icon'=>'jpeg', 'groups'=>array('image', 'web_image'), 'string'=>'image'),
'jpg' => array ('type'=>'image/jpeg', 'icon'=>'jpeg', 'groups'=>array('image', 'web_image'), 'string'=>'image'),
View
2 version.php
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2012120306.04; // 20121203 = branching date YYYYMMDD - do not modify!
+$version = 2012120306.05; // 20121203 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches
// .XX = incremental changes

0 comments on commit f63fc5c

Please sign in to comment.