r100037 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100036‎ | r100037 | r100038 >
Date:15:29, 17 October 2011
Author:ialex
Status:deferred
Tags:
Comment:
Use ParserOptions::newFromUser() instead of creating a ParserOption and then calling its initialiseFromUser() method
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_RunQuery.php (modified) (history)
  • /trunk/extensions/TemplateLink/TemplateLink.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_RunQuery.php
@@ -83,8 +83,7 @@
8484
8585 if ( $form_submitted ) {
8686 global $wgUser, $wgTitle, $wgOut;
87 - $wgParser->mOptions = new ParserOptions();
88 - $wgParser->mOptions->initialiseFromUser( $wgUser );
 87+ $wgParser->mOptions = ParserOptions::newFromUser( $wgUser );
8988 // @TODO - fix RunQuery's parsing so that this check
9089 // isn't needed.
9190 if ( $wgParser->getOutput() == null ) {
Index: trunk/extensions/TemplateLink/TemplateLink.body.php
@@ -49,8 +49,7 @@
5050 function sandboxParse($wikiText){
5151 global $wgUser;
5252 $myParser = new Parser();
53 - $myParserOptions = new ParserOptions();
54 - $myParserOptions->initialiseFromUser($wgUser);
 53+ $myParserOptions = ParserOptions::newFromUser( $wgUser );
5554 $result = $myParser->parse($wikiText, $this->getTitle(), $myParserOptions);
5655 return $result->getText();
5756 }

Status & tagging log