(bug 13005) DISPLAYTITLE does not work on preview
authorHuji <huji@users.mediawiki.org>
Wed, 13 Feb 2008 21:34:35 +0000 (21:34 +0000)
committerHuji <huji@users.mediawiki.org>
Wed, 13 Feb 2008 21:34:35 +0000 (21:34 +0000)
RELEASE-NOTES
includes/EditPage.php

index f5ac33b..efe8808 100644 (file)
@@ -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 ==
 
index 33e4069..0cdc21c 100644 (file)
@@ -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)