X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FEditPage.php;h=5e3a964842059e6b37f28352241d9cd7e06851a8;hb=313298d9d77a2cb37f806466de897c4fa30e420a;hp=052a7834d4a0e4620b52a329972c37b622560ba2;hpb=140c34d3c1292fb5ecf156b04f5ce5ed165b3d3e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/EditPage.php b/includes/EditPage.php index 052a7834d4..5e3a964842 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1603,21 +1603,21 @@ class EditPage { # Enabled article-related sidebar, toplinks, etc. $wgOut->setArticleRelated( true ); + $contextTitle = $this->getContextTitle(); if ( $this->isConflict ) { - $wgOut->setPageTitle( wfMessage( 'editconflict', $this->getContextTitle()->getPrefixedText() ) ); - } elseif ( $this->section != '' ) { + $msg = 'editconflict'; + } elseif ( $contextTitle->exists() && $this->section != '' ) { $msg = $this->section == 'new' ? 'editingcomment' : 'editingsection'; - $wgOut->setPageTitle( wfMessage( $msg, $this->getContextTitle()->getPrefixedText() ) ); } else { - # Use the title defined by DISPLAYTITLE magic word when present - if ( isset( $this->mParserOutput ) - && ( $dt = $this->mParserOutput->getDisplayTitle() ) !== false ) { - $title = $dt; - } else { - $title = $this->getContextTitle()->getPrefixedText(); - } - $wgOut->setPageTitle( wfMessage( 'editing', $title ) ); + $msg = $contextTitle->exists() || ( $contextTitle->getNamespace() == NS_MEDIAWIKI && $contextTitle->getDefaultMessageText() !== false ) ? + 'editing' : 'creating'; + } + # Use the title defined by DISPLAYTITLE magic word when present + $displayTitle = isset( $this->mParserOutput ) ? $this->mParserOutput->getDisplayTitle() : false; + if ( $displayTitle === false ) { + $displayTitle = $contextTitle->getPrefixedText(); } + $wgOut->setPageTitle( wfMessage( $msg, $displayTitle ) ); } /**