Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -512,7 +512,7 @@ |
513 | 513 | if ( $redirHtml != '' ) { |
514 | 514 | $wgOut->addHtml( $redirHtml ); |
515 | 515 | } else { |
516 | | - $wgOut->addParserOutput( $parserOut ); |
| 516 | + $this->addParserOutput( $parserOut ); |
517 | 517 | } |
518 | 518 | } |
519 | 519 | |
— | — | @@ -600,10 +600,22 @@ |
601 | 601 | $wgOut->addHtml( $redirHtml ); |
602 | 602 | } else { |
603 | 603 | // $parserOut will not be null here |
604 | | - $wgOut->addParserOutput( $parserOut ); |
| 604 | + $this->addParserOutput( $parserOut ); |
605 | 605 | } |
606 | 606 | } |
607 | 607 | |
| 608 | + // Add parser output and update title |
| 609 | + // @TODO: refactor MW core to move this back |
| 610 | + protected function addParserOutput( ParserOutput $parserOut ) { |
| 611 | + global $wgOut; |
| 612 | + $wgOut->addParserOutput( $parserOut ); |
| 613 | + # Adjust the title if it was set by displaytitle, -{T|}- or language conversion |
| 614 | + $titleText = $parserOut->getTitleText(); |
| 615 | + if ( strval( $titleText ) !== '' ) { |
| 616 | + $wgOut->setPageTitle( $titleText ); |
| 617 | + } |
| 618 | + } |
| 619 | + |
608 | 620 | // Get fancy redirect arrow and link HTML |
609 | 621 | protected function getRedirectHtml( $text ) { |
610 | 622 | $rTarget = $this->article->followRedirectText( $text ); |