if ( is_null( $mime ) ) {
return; // skip any initialization
}
-
- if( !$this->getMain()->isInternalMode() ) {
- header( "Content-Type: $mime; charset=utf-8" );
- }
+
+ $this->getMain()->getRequest()->response()->header( "Content-Type: $mime; charset=utf-8" );
if ( $isHtml ) {
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE HTML>
<html>
<head>
<?php if ( $this->mUnescapeAmps ) {
* @return string
*/
protected function formatHTML( $text ) {
- global $wgUrlProtocols;
-
// Escape everything first for full coverage
$text = htmlspecialchars( $text );
// encode all comments or tags as safe blue strings
$text = preg_replace( '/\<(!--.*?--|.*?)\>/', '<span style="color:blue;"><\1></span>', $text );
// identify URLs
- $protos = implode( "|", $wgUrlProtocols );
+ $protos = wfUrlProtocolsWithoutProtRel();
// This regex hacks around bug 13218 (" included in the URL)
$text = preg_replace( "#(($protos).*?)(")?([ \\'\"<>\n]|<|>|")#", '<a href="\\1">\\1</a>\\3\\4', $text );
// identify requests to api.php
return $text;
}
- protected function getExamples() {
+ public function getExamples() {
return 'api.php?action=query&meta=siteinfo&siprop=namespaces&format=' . $this->getModuleName();
}
+ public function getHelpUrls() {
+ return 'http://www.mediawiki.org/wiki/API:Data_formats';
+ }
+
public function getDescription() {
return $this->getIsHtml() ? ' (pretty-print in HTML)' : '';
}
public function getVersion() {
return __CLASS__ . ': $Id$';
}
-}
\ No newline at end of file
+}