Index: trunk/phase3/includes/Article.php |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | var $mTouched = '19700101000000'; // !< |
42 | 42 | var $mUser = -1; // !< Not loaded |
43 | 43 | var $mUserText = ''; // !< username from Revision if set |
44 | | - var $mParserOptions; // !< ParserOptions object for $wgUser articles |
| 44 | + var $mParserOptions; // !< ParserOptions object |
45 | 45 | var $mParserOutput; // !< ParserCache object if set |
46 | 46 | /**@}}*/ |
47 | 47 | |
— | — | @@ -3610,7 +3610,7 @@ |
3611 | 3611 | $edit->revid = $revid; |
3612 | 3612 | $edit->newText = $text; |
3613 | 3613 | $edit->pst = $this->preSaveTransform( $text, $user, $popts ); |
3614 | | - $edit->popts = $this->getParserOptions( true ); |
| 3614 | + $edit->popts = $this->getParserOptions(); |
3615 | 3615 | $edit->output = $wgParser->parse( $edit->pst, $this->mTitle, $edit->popts, true, true, $revid ); |
3616 | 3616 | $edit->oldText = $this->getRawText(); |
3617 | 3617 | |
— | — | @@ -4395,23 +4395,15 @@ |
4396 | 4396 | |
4397 | 4397 | /** |
4398 | 4398 | * Get parser options suitable for rendering the primary article wikitext |
4399 | | - * @param $canonical boolean Determines that the generated must not depend on user preferences (see bug 14404) |
4400 | 4399 | * @return mixed ParserOptions object or boolean false |
4401 | 4400 | */ |
4402 | | - public function getParserOptions( $canonical = false ) { |
4403 | | - global $wgUser, $wgLanguageCode; |
| 4401 | + public function getParserOptions() { |
| 4402 | + global $wgUser; |
4404 | 4403 | |
4405 | | - if ( !$this->mParserOptions || $canonical ) { |
4406 | | - $user = !$canonical ? $wgUser : new User; |
4407 | | - $parserOptions = new ParserOptions( $user ); |
4408 | | - $parserOptions->setTidy( true ); |
4409 | | - $parserOptions->enableLimitReport(); |
4410 | | - |
4411 | | - if ( $canonical ) { |
4412 | | - $parserOptions->setUserLang( $wgLanguageCode ); # Must be set explicitely |
4413 | | - return $parserOptions; |
4414 | | - } |
4415 | | - $this->mParserOptions = $parserOptions; |
| 4404 | + if ( !$this->mParserOptions ) { |
| 4405 | + $this->mParserOptions = new ParserOptions( $wgUser ); |
| 4406 | + $this->mParserOptions->setTidy( true ); |
| 4407 | + $this->mParserOptions->enableLimitReport(); |
4416 | 4408 | } |
4417 | 4409 | |
4418 | 4410 | // Clone to allow modifications of the return value without affecting |