From: Alexandre Emsenhuber Date: Sun, 11 Dec 2011 10:16:32 +0000 (+0000) Subject: Use ParserOptions::newFromContext() instead of 'new ParserOptions' to use the local... X-Git-Tag: 1.31.0-rc.0~26092 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=55ec0e84aab9627d8f33e26400fdc26b7aacaa33;p=lhc%2Fweb%2Fwiklou.git Use ParserOptions::newFromContext() instead of 'new ParserOptions' to use the local context and not $wgUser or $wgLang --- 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 ) {