r36098 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36097‎ | r36098 | r36099 >
Date:19:25, 9 June 2008
Author:aaron
Status:old
Tags:
Comment:
Be consistent with parser options
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -161,8 +161,7 @@
162162 # Make our hooks to trigger
163163 $wgParser->fr_isStable = true;
164164 # Parse with default options
165 - $options = new ParserOptions();
166 - $options->setRemoveComments( true ); // Save some bandwidth ;)
 165+ $options = self::makeParserOptions();
167166 $outputText = $wgParser->preprocess( $text, $title, $options, $id );
168167 $out =& $wgParser->mOutput;
169168 $data = array( $outputText, $out->mTemplates, $out->mTemplateIds, $out->fr_includeErrors, $out->fr_newestTemplateID );
@@ -226,8 +225,9 @@
227226 /**
228227 * Get standard parser options
229228 */
230 - public static function makeParserOptions( $user = NULL ) {
231 - $options = $user ? ParserOptions::newFromUser( $user ) : new ParserOptions();
 229+ public static function makeParserOptions() {
 230+ global $wgUser;
 231+ $options = ParserOptions::newFromUser($wgUser);
232232 # Show inclusion/loop reports
233233 $options->enableLimitReport();
234234 # Fix bad HTML
@@ -454,7 +454,7 @@
455455 if( $currentOutput==false ) {
456456 $text = $article->getContent();
457457 $title = $article->getTitle();
458 - $options = self::makeParserOptions( $wgUser );
 458+ $options = self::makeParserOptions();
459459 $currentOutput = $wgParser->parse( $text, $title, $options );
460460 # Might as well save the cache while we're at it
461461 global $wgEnableParserCache;
@@ -557,7 +557,7 @@
558558 $poutput = $parserCache->get( $article, $wgUser );
559559 if( $poutput==false ) {
560560 $text = $article->getContent();
561 - $options = self::makeParserOptions( $wgUser );
 561+ $options = self::makeParserOptions();
562562 $poutput = $wgParser->parse($text, $article->getTitle(), $options);
563563 # Might as well save the cache while we're at it
564564 global $wgEnableParserCache;
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.php
@@ -621,7 +621,7 @@
622622 $poutput = $parserCache->get( $article, $wgUser );
623623 if( $poutput==false ) {
624624 $text = $article->getContent();
625 - $options = FlaggedRevs::makeParserOptions( $wgUser );
 625+ $options = FlaggedRevs::makeParserOptions();
626626 $poutput = $wgParser->parse( $text, $article->mTitle, $options );
627627 }
628628 # If we know that this is now the new stable version
@@ -689,7 +689,7 @@
690690 $poutput = $parserCache->get( $article, $wgUser );
691691 if( $poutput==false ) {
692692 $text = $article->getContent();
693 - $options = FlaggedRevs::makeParserOptions( $wgUser );
 693+ $options = FlaggedRevs::makeParserOptions();
694694 $poutput = $wgParser->parse( $text, $article->mTitle, $options );
695695 }
696696 $u = new LinksUpdate( $this->page, $poutput );

Status & tagging log