Display permissions specific to the API (such as writeapi and apihighlimits) on actio...
[lhc/web/wiklou.git] / includes / MimeMagic.php
index e7c30ed..ec4505a 100644 (file)
@@ -9,7 +9,7 @@
  * the file mime.types in the includes directory.
  */
 define('MM_WELL_KNOWN_MIME_TYPES',<<<END_STRING
-application/ogg ogg ogm
+application/ogg ogg ogm ogv
 application/pdf pdf
 application/x-javascript js
 application/x-shockwave-flash swf
@@ -29,7 +29,7 @@ image/x-portable-pixmap ppm
 image/x-xcf xcf
 text/plain txt
 text/html html htm
-video/ogg ogm ogg
+video/ogg ogm ogg ogv
 video/mpeg mpg mpeg
 END_STRING
 );
@@ -360,7 +360,7 @@ class MimeMagic {
                        'xbm',
 
                        // Formats we recognize magic numbers for
-                       'djvu', 'ogg', 'mid', 'pdf', 'wmf', 'xcf',
+                       'djvu', 'ogg', 'ogv', 'mid', 'pdf', 'wmf', 'xcf',
 
                        // XML formats we sure hope we recognize reliably
                        'svg',
@@ -457,18 +457,10 @@ class MimeMagic {
                 */
                $xml = new XmlTypeCheck( $file );
                if( $xml->wellFormed ) {
-                       $types = array(
-                               'http://www.w3.org/2000/svg:svg'                => 'image/svg+xml',
-                               'svg'                                           => 'image/svg+xml',
-                               'http://www.lysator.liu.se/~alla/dia/:diagram'  => 'application/x-dia-diagram',
-                               'http://www.w3.org/1999/xhtml:html'             => 'text/html', // application/xhtml+xml?
-                               'html'                                          => 'text/html', // application/xhtml+xml?
-                       );
-                       if( isset( $types[$xml->rootElement] ) ) {
-                               $mime = $types[$xml->rootElement];
-                               return $mime;
+                       global $wgXMLMimeTypes;
+                       if( isset( $wgXMLMimeTypes[$xml->rootElement] ) ) {
+                               return $wgXMLMimeTypes[$xml->rootElement];
                        } else {
-                               /// Fixme -- this would be the place to allow additional XML type checks
                                return 'application/xml';
                        }
                }