Index: trunk/phase3/includes/WikiPage.php |
— | — | @@ -2563,21 +2563,13 @@ |
2564 | 2564 | * Get parser options suitable for rendering the primary article wikitext |
2565 | 2565 | * @param $canonical boolean Determines that the generated options must not depend on user preferences (see bug 14404) |
2566 | 2566 | * @return mixed ParserOptions object or boolean false |
| 2567 | + * @deprecated since 1.19 |
2567 | 2568 | */ |
2568 | 2569 | public function getParserOptions( $canonical = false ) { |
2569 | 2570 | global $wgUser, $wgLanguageCode; |
2570 | | - |
2571 | 2571 | if ( !$this->mParserOptions || $canonical ) { |
2572 | 2572 | $user = !$canonical ? $wgUser : new User; |
2573 | | - $parserOptions = new ParserOptions( $user ); |
2574 | | - $parserOptions->setTidy( true ); |
2575 | | - $parserOptions->enableLimitReport(); |
2576 | | - |
2577 | | - if ( $canonical ) { |
2578 | | - $parserOptions->setUserLang( $wgLanguageCode ); # Must be set explicitely |
2579 | | - return $parserOptions; |
2580 | | - } |
2581 | | - $this->mParserOptions = $parserOptions; |
| 2573 | + $this->mParserOptions = $this->makeParserOptions( $user ); |
2582 | 2574 | } |
2583 | 2575 | // Clone to allow modifications of the return value without affecting cache |
2584 | 2576 | return clone $this->mParserOptions; |
— | — | @@ -2589,9 +2581,13 @@ |
2590 | 2582 | * @return ParserOptions |
2591 | 2583 | */ |
2592 | 2584 | public function makeParserOptions( User $user ) { |
| 2585 | + global $wgLanguageCode; |
2593 | 2586 | $options = ParserOptions::newFromUser( $user ); |
2594 | 2587 | $options->enableLimitReport(); // show inclusion/loop reports |
2595 | 2588 | $options->setTidy( true ); // fix bad HTML |
| 2589 | + if ( $user->isAnon() ) { |
| 2590 | + $options->setUserLang( $wgLanguageCode ); # Must be set explicitily |
| 2591 | + } |
2596 | 2592 | return $options; |
2597 | 2593 | } |
2598 | 2594 | |