summaryrefslogtreecommitdiff
path: root/includes/content/ContentHandler.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/content/ContentHandler.php')
-rw-r--r--includes/content/ContentHandler.php19
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;