Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'MDL-35141-master' of git://github.com/sammarshallou/moodle

  • Loading branch information...
commit b9570857db345580fc7582802330a53326443c21 2 parents 65095da + ed0f5a9
Eloy Lafuente (stronk7) authored October 09, 2012
1  lang/en/mimetypes.php
@@ -46,6 +46,7 @@
46 46
 $string['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'] = 'Excel spreadsheet';
47 47
 $string['application/vnd.openxmlformats-officedocument.spreadsheetml.template'] = 'Excel template';
48 48
 $string['application/vnd.openxmlformats-officedocument.wordprocessingml.document'] = 'Word document';
  49
+$string['application/epub_zip'] = 'EPUB ebook';
49 50
 $string['archive'] = 'Archive ({$a->EXT})';
50 51
 $string['audio'] = 'Audio file ({$a->EXT})';
51 52
 $string['default'] = '{$a->mimetype}';
13  lib/filelib.php
@@ -1404,6 +1404,7 @@ function &get_mimetypes_array() {
1404 1404
         'dir'  => array ('type'=>'application/x-director', 'icon'=>'flash'),
1405 1405
         'dxr'  => array ('type'=>'application/x-director', 'icon'=>'flash'),
1406 1406
         'eps'  => array ('type'=>'application/postscript', 'icon'=>'eps'),
  1407
+        'epub' => array ('type'=>'application/epub+zip', 'icon'=>'epub', 'groups'=>array('document')),
1407 1408
         'fdf'  => array ('type'=>'application/pdf', 'icon'=>'pdf'),
1408 1409
         'flv'  => array ('type'=>'video/x-flv', 'icon'=>'flash', 'groups'=>array('video','web_video'), 'string'=>'video'),
1409 1410
         'f4v'  => array ('type'=>'video/mp4', 'icon'=>'flash', 'groups'=>array('video','web_video'), 'string'=>'video'),
@@ -1817,10 +1818,14 @@ function get_mimetype_description($obj, $capitalise=false) {
1817 1818
         $a[strtoupper($key)] = strtoupper($value);
1818 1819
         $a[ucfirst($key)] = ucfirst($value);
1819 1820
     }
1820  
-    if (get_string_manager()->string_exists($mimetype, 'mimetypes')) {
1821  
-        $result = get_string($mimetype, 'mimetypes', (object)$a);
1822  
-    } else if (get_string_manager()->string_exists($mimetypestr, 'mimetypes')) {
1823  
-        $result = get_string($mimetypestr, 'mimetypes', (object)$a);
  1821
+
  1822
+    // MIME types may include + symbol but this is not permitted in string ids.
  1823
+    $safemimetype = str_replace('+', '_', $mimetype);
  1824
+    $safemimetypestr = str_replace('+', '_', $mimetypestr);
  1825
+    if (get_string_manager()->string_exists($safemimetype, 'mimetypes')) {
  1826
+        $result = get_string($safemimetype, 'mimetypes', (object)$a);
  1827
+    } else if (get_string_manager()->string_exists($safemimetypestr, 'mimetypes')) {
  1828
+        $result = get_string($safemimetypestr, 'mimetypes', (object)$a);
1824 1829
     } else if (get_string_manager()->string_exists('default', 'mimetypes')) {
1825 1830
         $result = get_string('default', 'mimetypes', (object)$a);
1826 1831
     } else {
BIN  pix/f/epub.png

0 notes on commit b957085

Please sign in to comment.
Something went wrong with that request. Please try again.