From: Alexandre Emsenhuber Date: Fri, 28 Nov 2008 18:37:31 +0000 (+0000) Subject: Do the same as r41813, but for non-edit page: Display default extensions messages... X-Git-Tag: 1.31.0-rc.0~44175 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=141ab05e8ab6de6007b1ede1ba2ee37613bf8f4f;p=lhc%2Fweb%2Fwiklou.git Do the same as r41813, but for non-edit page: Display default extensions messages for language subpages when the page being viewed doesn't exist --- diff --git a/includes/Article.php b/includes/Article.php index f0d45628c1..ee2d889a57 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -205,14 +205,18 @@ class Article { * @return Return the text of this revision */ public function getContent() { - global $wgUser, $wgOut, $wgMessageCache; + global $wgUser, $wgContLang, $wgOut, $wgMessageCache; wfProfileIn( __METHOD__ ); if( $this->getID() === 0 ) { # If this is a MediaWiki:x message, then load the messages # and return the message value for x. if( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { - $wgMessageCache->loadAllMessages(); - $text = wfMsgWeirdKey( $this->mTitle->getText() ) ; + # If this is a system message, get the default text. + list( $message, $lang ) = $wgMessageCache->figureMessage( $wgContLang->lcfirst( $this->mTitle->getText() ) ); + $wgMessageCache->loadAllMessages( $lang ); + $text = wfMsgGetKey( $message, false, $lang, false ); + if( wfEmptyMsg( $message, $text ) ) + $text = ''; } else { $text = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ); }