From 55ec0e84aab9627d8f33e26400fdc26b7aacaa33 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sun, 11 Dec 2011 10:16:32 +0000 Subject: [PATCH] Use ParserOptions::newFromContext() instead of 'new ParserOptions' to use the local context and not $wgUser or $wgLang --- includes/api/ApiQueryRevisions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 2eff91f1f7..7cfe3f42bf 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -462,7 +462,7 @@ class ApiQueryRevisions extends ApiQueryBase { } if ( $this->fld_content && !$revision->isDeleted( Revision::DELETED_TEXT ) ) { if ( $this->generateXML ) { - $wgParser->startExternalParse( $title, new ParserOptions(), OT_PREPROCESS ); + $wgParser->startExternalParse( $title, ParserOptions::newFromContext( $this->getContext() ), OT_PREPROCESS ); $dom = $wgParser->preprocessToDom( $text ); if ( is_callable( array( $dom, 'saveXML' ) ) ) { $xml = $dom->saveXML(); @@ -473,10 +473,10 @@ class ApiQueryRevisions extends ApiQueryBase { } if ( $this->expandTemplates && !$this->parseContent ) { - $text = $wgParser->preprocess( $text, $title, new ParserOptions() ); + $text = $wgParser->preprocess( $text, $title, ParserOptions::newFromContext( $this->getContext() ) ); } if ( $this->parseContent ) { - $text = $wgParser->parse( $text, $title, new ParserOptions() )->getText(); + $text = $wgParser->parse( $text, $title, ParserOptions::newFromContext( $this->getContext() ) )->getText(); } ApiResult::setContent( $vals, $text ); } elseif ( $this->fld_content ) { -- 2.20.1