Use ParserOptions::newFromContext() instead of 'new ParserOptions' to use the local...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 11 Dec 2011 10:16:32 +0000 (10:16 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 11 Dec 2011 10:16:32 +0000 (10:16 +0000)
includes/api/ApiQueryRevisions.php

index 2eff91f..7cfe3f4 100644 (file)
@@ -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 ) {