From 8fd7f4764b9c10323fbf8f64d183ddb32ac684eb Mon Sep 17 00:00:00 2001 From: Huji Date: Wed, 13 Feb 2008 21:34:35 +0000 Subject: [PATCH] (bug 13005) DISPLAYTITLE does not work on preview --- RELEASE-NOTES | 2 +- includes/EditPage.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f5ac33bd04..efe8808499 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -394,7 +394,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN its callers already * (bug 12846) IE rtl.css issue in RTL wikis special:Preferences when selecting an LTR user language - +* (bug 13005) DISPLAYTITLE does not work on preview == Parser changes in 1.12 == diff --git a/includes/EditPage.php b/includes/EditPage.php index 33e40698c0..0cdc21c131 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1526,7 +1526,12 @@ END $wgOut->addParserOutputNoText( $parserOutput ); # ParserOutput might have altered the page title, so reset it - $wgOut->setPageTitle( wfMsg( 'editing', $wgTitle->getPrefixedText() ) ); + # Also, use the title defined by DISPLAYTITLE magic word when present + if( ( $dt = $parserOutput->getDisplayTitle() ) !== false ) { + $wgOut->setPageTitle( wfMsg( 'editing', $dt ) ); + } else { + $wgOut->setPageTitle( wfMsg( 'editing', $wgTitle->getPrefixedText() ) ); + } foreach ( $parserOutput->getTemplates() as $ns => $template) foreach ( array_keys( $template ) as $dbk) -- 2.20.1