diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
commit | 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch) | |
tree | af68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /includes/content/ContentHandler.php | |
parent | af4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff) |
Update to MediaWiki 1.22.0
Diffstat (limited to 'includes/content/ContentHandler.php')
-rw-r--r-- | includes/content/ContentHandler.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index 9c201955..2a92e233 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -319,7 +319,7 @@ abstract class ContentHandler { wfRunHooks( 'ContentHandlerForModelID', array( $modelId, &$handler ) ); if ( $handler === null ) { - throw new MWException( "No handler for model '$modelId'' registered in \$wgContentHandlers" ); + throw new MWException( "No handler for model '$modelId' registered in \$wgContentHandlers" ); } if ( !( $handler instanceof ContentHandler ) ) { @@ -449,10 +449,11 @@ abstract class ContentHandler { * @since 1.21 * * @param Title $destination the page to redirect to. + * @param string $text text to include in the redirect, if possible. * * @return Content */ - public function makeRedirectContent( Title $destination ) { + public function makeRedirectContent( Title $destination, $text = '' ) { return null; } @@ -937,7 +938,7 @@ abstract class ContentHandler { * @return ParserOptions */ public function makeParserOptions( $context ) { - global $wgContLang; + global $wgContLang, $wgEnableParserLimitReporting; if ( $context instanceof IContextSource ) { $options = ParserOptions::newFromContext( $context ); @@ -949,7 +950,7 @@ abstract class ContentHandler { throw new MWException( "Bad context for parser options: $context" ); } - $options->enableLimitReport(); // show inclusion/loop reports + $options->enableLimitReport( $wgEnableParserLimitReporting ); // show inclusion/loop reports $options->setTidy( true ); // fix bad HTML return $options; @@ -1060,7 +1061,7 @@ abstract class ContentHandler { if ( isset( $handler[1] ) ) { $info .= '::' . $handler[1]; } - } else if ( is_object( $handler ) ) { + } elseif ( is_object( $handler ) ) { $info = get_class( $handler[0] ); $info .= '::on' . $event; } else { @@ -1086,8 +1087,8 @@ abstract class ContentHandler { $contentObjects[$k] = $v; $v = $v->serialize(); - $contentTexts[ $k ] = $v; - $args[ $k ] = $v; + $contentTexts[$k] = $v; + $args[$k] = $v; } } @@ -1098,7 +1099,7 @@ abstract class ContentHandler { foreach ( $contentTexts as $k => $orig ) { /* @var Content $content */ - $modified = $args[ $k ]; + $modified = $args[$k]; $content = $contentObjects[$k]; if ( $modified !== $orig ) { @@ -1106,7 +1107,7 @@ abstract class ContentHandler { $content = $content->getContentHandler()->unserializeContent( $modified ); } - $args[ $k ] = $content; + $args[$k] = $content; } return $ok; |