r44024 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44023‎ | r44024 | r44025 >
Date:18:37, 28 November 2008
Author:ialex
Status:ok
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -205,14 +205,18 @@
206206 * @return Return the text of this revision
207207 */
208208 public function getContent() {
209 - global $wgUser, $wgOut, $wgMessageCache;
 209+ global $wgUser, $wgContLang, $wgOut, $wgMessageCache;
210210 wfProfileIn( __METHOD__ );
211211 if( $this->getID() === 0 ) {
212212 # If this is a MediaWiki:x message, then load the messages
213213 # and return the message value for x.
214214 if( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
215 - $wgMessageCache->loadAllMessages();
216 - $text = wfMsgWeirdKey( $this->mTitle->getText() ) ;
 215+ # If this is a system message, get the default text.
 216+ list( $message, $lang ) = $wgMessageCache->figureMessage( $wgContLang->lcfirst( $this->mTitle->getText() ) );
 217+ $wgMessageCache->loadAllMessages( $lang );
 218+ $text = wfMsgGetKey( $message, false, $lang, false );
 219+ if( wfEmptyMsg( $message, $text ) )
 220+ $text = '';
217221 } else {
218222 $text = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' );
219223 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r41813* Display default extensions messages for language subpages when the page bei...ialex18:10, 7 October 2008

Status & tagging log