From f05145c821cedcb7825f7ea0336419c2cdc58276 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 9 Aug 2010 07:41:25 +0000 Subject: [PATCH] Per CR r52888, have Article::getParserOptions() clone the object itself, so that the caller doesn't have to do it. --- includes/Article.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 679bfcd890..dc2d901ed1 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -834,7 +834,7 @@ class Article { $oldid = $this->getOldID(); $parserCache = ParserCache::singleton(); - $parserOptions = clone $this->getParserOptions(); + $parserOptions = $this->getParserOptions(); # Render printable version, use printable version cache if ( $wgOut->isPrintable() ) { $parserOptions->setIsPrintable( true ); @@ -1470,7 +1470,7 @@ class Article { $oldid = $this->getOldID(); $useParserCache = $this->useParserCache( $oldid ); - $parserOptions = clone $this->getParserOptions(); + $parserOptions = $this->getParserOptions(); # Render printable version, use printable version cache $parserOptions->setIsPrintable( $wgOut->isPrintable() ); @@ -4465,7 +4465,9 @@ class Article { $this->mParserOptions->enableLimitReport(); } - return $this->mParserOptions; + // Clone to allow modifications of the return value without affecting + // the cache + return clone $this->mParserOptions; } /** -- 2.20.1