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 $wgXMLMimeTypes, an array of XML mimetypes we can check for |
| 69 | + with MimeMagic. |
68 | 70 | |
69 | 71 | === New features in 1.13 === |
70 | 72 | |
Index: trunk/phase3/includes/MimeMagic.php |
— | — | @@ -457,18 +457,10 @@ |
458 | 458 | */ |
459 | 459 | $xml = new XmlTypeCheck( $file ); |
460 | 460 | if( $xml->wellFormed ) { |
461 | | - $types = array( |
462 | | - 'http://www.w3.org/2000/svg:svg' => 'image/svg+xml', |
463 | | - 'svg' => 'image/svg+xml', |
464 | | - 'http://www.lysator.liu.se/~alla/dia/:diagram' => 'application/x-dia-diagram', |
465 | | - 'http://www.w3.org/1999/xhtml:html' => 'text/html', // application/xhtml+xml? |
466 | | - 'html' => 'text/html', // application/xhtml+xml? |
467 | | - ); |
468 | | - if( isset( $types[$xml->rootElement] ) ) { |
469 | | - $mime = $types[$xml->rootElement]; |
470 | | - return $mime; |
| 461 | + global $wgXMLMimeTypes; |
| 462 | + if( isset( $wgXMLMimeTypes[$xml->rootElement] ) ) { |
| 463 | + return $wgXMLMimeTypes[$xml->rootElement]; |
471 | 464 | } else { |
472 | | - /// Fixme -- this would be the place to allow additional XML type checks |
473 | 465 | return 'application/xml'; |
474 | 466 | } |
475 | 467 | } |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -367,6 +367,18 @@ |
368 | 368 | $wgTrivialMimeDetection= false; |
369 | 369 | |
370 | 370 | /** |
| 371 | + * Additional XML types we can allow via mime-detection. |
| 372 | + * array = ( 'rootElement' => 'associatedMimeType' ) |
| 373 | + */ |
| 374 | +$wgXMLMimeTypes = array( |
| 375 | + 'http://www.w3.org/2000/svg:svg' => 'image/svg+xml', |
| 376 | + 'svg' => 'image/svg+xml', |
| 377 | + 'http://www.lysator.liu.se/~alla/dia/:diagram' => 'application/x-dia-diagram', |
| 378 | + 'http://www.w3.org/1999/xhtml:html' => 'text/html', // application/xhtml+xml? |
| 379 | + 'html' => 'text/html', // application/xhtml+xml? |
| 380 | +); |
| 381 | + |
| 382 | +/** |
371 | 383 | * To set 'pretty' URL paths for actions other than |
372 | 384 | * plain page views, add to this array. For instance: |
373 | 385 | * 'edit' => "$wgScriptPath/edit/$1" |