Index: trunk/phase3/includes/Parser.php |
— | — | @@ -2441,7 +2441,7 @@ |
2442 | 2442 | * @access private |
2443 | 2443 | */ |
2444 | 2444 | function braceSubstitution( $piece ) { |
2445 | | - global $wgContLang, $wgAllowDisplayTitle; |
| 2445 | + global $wgContLang, $wgAllowDisplayTitle, $action; |
2446 | 2446 | $fname = 'Parser::braceSubstitution'; |
2447 | 2447 | wfProfileIn( $fname ); |
2448 | 2448 | |
— | — | @@ -2613,27 +2613,30 @@ |
2614 | 2614 | } |
2615 | 2615 | |
2616 | 2616 | # DISPLAYTITLE |
2617 | | - if ( !$found && $argc == 1 && $wgAllowDisplayTitle ) { |
2618 | | - global $wgOut; |
2619 | | - |
2620 | | - # Only the first one counts... |
2621 | | - if ( $wgOut->mPageLinkTitle == "" ) { |
2622 | | - $param = $args[0]; |
2623 | | - $parserOptions = new ParserOptions; |
2624 | | - $local_parser = new Parser (); |
2625 | | - $t2 = $local_parser->parse ( $param, $this->mTitle, $parserOptions, false ); |
2626 | | - $wgOut->mPageLinkTitle = $wgOut->getPageTitle(); |
2627 | | - $wgOut->mPagetitle = $t2->GetText(); |
2628 | | - |
2629 | | - # Add subtitle |
2630 | | - $t = $this->mTitle->getPrefixedText(); |
2631 | | - $st = trim ( $wgOut->getSubtitle () ); |
2632 | | - if ( $st != "" ) $st .= " "; |
2633 | | - $st .= str_replace ( "$1", $t, wfMsg('displaytitle') ); |
2634 | | - $wgOut->setSubtitle ( $st ); |
| 2617 | + if ( !$found && $argc == 1 && $wgAllowDisplayTitle && $action == "view" ) { |
| 2618 | + $mwDT =& MagicWord::get( MAG_DISPLAYTITLE ); |
| 2619 | + if ( $mwDT->matchStartAndRemove( $part1 ) ) { |
| 2620 | + global $wgOut; |
| 2621 | + |
| 2622 | + # Only the first one counts... |
| 2623 | + if ( $wgOut->mPageLinkTitle == "" ) { |
| 2624 | + $param = $args[0]; |
| 2625 | + $parserOptions = new ParserOptions; |
| 2626 | + $local_parser = new Parser (); |
| 2627 | + $t2 = $local_parser->parse ( $param, $this->mTitle, $parserOptions, false ); |
| 2628 | + $wgOut->mPageLinkTitle = $wgOut->getPageTitle(); |
| 2629 | + $wgOut->mPagetitle = $t2->GetText(); |
| 2630 | + |
| 2631 | + # Add subtitle |
| 2632 | + $t = $this->mTitle->getPrefixedText(); |
| 2633 | + $st = trim ( $wgOut->getSubtitle () ); |
| 2634 | + if ( $st != "" ) $st .= " "; |
| 2635 | + $st .= wfMsg('displaytitle', $t); |
| 2636 | + $wgOut->setSubtitle ( $st ); |
| 2637 | + } |
| 2638 | + $text = "" ; |
| 2639 | + $found = true ; |
2635 | 2640 | } |
2636 | | - $text = "" ; |
2637 | | - $found = true ; |
2638 | 2641 | } |
2639 | 2642 | |
2640 | 2643 | # Extensions |