r70751 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70750‎ | r70751 | r70752 >
Date:07:41, 9 August 2010
Author:tstarling
Status:ok
Tags:
Comment:
Per CR r52888, have Article::getParserOptions() clone the object itself, so that the caller doesn't have to do it.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -834,7 +834,7 @@
835835 $oldid = $this->getOldID();
836836 $parserCache = ParserCache::singleton();
837837
838 - $parserOptions = clone $this->getParserOptions();
 838+ $parserOptions = $this->getParserOptions();
839839 # Render printable version, use printable version cache
840840 if ( $wgOut->isPrintable() ) {
841841 $parserOptions->setIsPrintable( true );
@@ -1470,7 +1470,7 @@
14711471
14721472 $oldid = $this->getOldID();
14731473 $useParserCache = $this->useParserCache( $oldid );
1474 - $parserOptions = clone $this->getParserOptions();
 1474+ $parserOptions = $this->getParserOptions();
14751475
14761476 # Render printable version, use printable version cache
14771477 $parserOptions->setIsPrintable( $wgOut->isPrintable() );
@@ -4465,7 +4465,9 @@
44664466 $this->mParserOptions->enableLimitReport();
44674467 }
44684468
4469 - return $this->mParserOptions;
 4469+ // Clone to allow modifications of the return value without affecting
 4470+ // the cache
 4471+ return clone $this->mParserOptions;
44704472 }
44714473
44724474 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r52888Implemented the PoolCounter feature and did some general refactoring in the a...tstarling08:12, 8 July 2009

Status & tagging log