Index: trunk/phase3/includes/MimeMagic.php |
— | — | @@ -457,6 +457,7 @@ |
458 | 458 | */ |
459 | 459 | $xml = new XmlTypeCheck( $file ); |
460 | 460 | if( $xml->wellFormed ) { |
| 461 | + global $wgAdditionalXMLTypes; |
461 | 462 | $types = array( |
462 | 463 | 'http://www.w3.org/2000/svg:svg' => 'image/svg+xml', |
463 | 464 | 'svg' => 'image/svg+xml', |
— | — | @@ -464,11 +465,12 @@ |
465 | 466 | 'http://www.w3.org/1999/xhtml:html' => 'text/html', // application/xhtml+xml? |
466 | 467 | 'html' => 'text/html', // application/xhtml+xml? |
467 | 468 | ); |
| 469 | + |
468 | 470 | if( isset( $types[$xml->rootElement] ) ) { |
469 | | - $mime = $types[$xml->rootElement]; |
470 | | - return $mime; |
| 471 | + return $types[$xml->rootElement]; |
| 472 | + } elseif( isset( $wgAdditionalXMLTypes[$xml->rootElement] ) ) { |
| 473 | + return $wgAdditionalXMLTypes[$xml->rootElement]; |
471 | 474 | } else { |
472 | | - /// Fixme -- this would be the place to allow additional XML type checks |
473 | 475 | return 'application/xml'; |
474 | 476 | } |
475 | 477 | } |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -367,6 +367,11 @@ |
368 | 368 | $wgTrivialMimeDetection= false; |
369 | 369 | |
370 | 370 | /** |
| 371 | + * Additional XML types we can allow via mime-detection. |
| 372 | + */ |
| 373 | +$wgAdditionalXMLTypes = array(); |
| 374 | + |
| 375 | +/** |
371 | 376 | * To set 'pretty' URL paths for actions other than |
372 | 377 | * plain page views, add to this array. For instance: |
373 | 378 | * 'edit' => "$wgScriptPath/edit/$1" |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -64,6 +64,8 @@ |
65 | 65 | previously it was choosen based on $wgParserCacheType |
66 | 66 | * $wgExtensionAliasesFiles option to simplify adding aliases to special pages |
67 | 67 | provided by extensions, in a similar way to $wgExtensionMessagesFiles |
| 68 | +* Added $wgAdditionalXMLTypes, an array of XML mimetypes we can check for |
| 69 | + with MimeMagic. |
68 | 70 | |
69 | 71 | === New features in 1.13 === |
70 | 72 | |