From 141ab05e8ab6de6007b1ede1ba2ee37613bf8f4f Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 28 Nov 2008 18:37:31 +0000 Subject: [PATCH] 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 --- includes/Article.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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' ); } -- 2.20.1