From 7222fb59d666e82c2091485a2fc1d5fc89678ab4 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 14 Mar 2011 04:26:52 +0000 Subject: [PATCH] Revert r79122, causes bug 27891 (old version seen immediately after edit). --- includes/Article.php | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 434c574126..bcb33056d7 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -40,7 +40,7 @@ class Article { var $mTouched = '19700101000000'; // !< var $mUser = -1; // !< Not loaded var $mUserText = ''; // !< username from Revision if set - var $mParserOptions; // !< ParserOptions object for $wgUser articles + var $mParserOptions; // !< ParserOptions object var $mParserOutput; // !< ParserCache object if set /**@}}*/ @@ -3610,7 +3610,7 @@ class Article { $edit->revid = $revid; $edit->newText = $text; $edit->pst = $this->preSaveTransform( $text, $user, $popts ); - $edit->popts = $this->getParserOptions( true ); + $edit->popts = $this->getParserOptions(); $edit->output = $wgParser->parse( $edit->pst, $this->mTitle, $edit->popts, true, true, $revid ); $edit->oldText = $this->getRawText(); @@ -4395,23 +4395,15 @@ class Article { /** * Get parser options suitable for rendering the primary article wikitext - * @param $canonical boolean Determines that the generated must not depend on user preferences (see bug 14404) * @return mixed ParserOptions object or boolean false */ - public function getParserOptions( $canonical = false ) { - global $wgUser, $wgLanguageCode; - - if ( !$this->mParserOptions || $canonical ) { - $user = !$canonical ? $wgUser : new User; - $parserOptions = new ParserOptions( $user ); - $parserOptions->setTidy( true ); - $parserOptions->enableLimitReport(); - - if ( $canonical ) { - $parserOptions->setUserLang( $wgLanguageCode ); # Must be set explicitely - return $parserOptions; - } - $this->mParserOptions = $parserOptions; + public function getParserOptions() { + global $wgUser; + + if ( !$this->mParserOptions ) { + $this->mParserOptions = new ParserOptions( $wgUser ); + $this->mParserOptions->setTidy( true ); + $this->mParserOptions->enableLimitReport(); } // Clone to allow modifications of the return value without affecting -- 2.20.1