r45673 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45672‎ | r45673 | r45674 >
Date:08:11, 12 January 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
brr, Article::getContent still has "side effects"
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -218,7 +218,7 @@
219219 if( wfEmptyMsg( $message, $text ) )
220220 $text = '';
221221 } else {
222 - $text = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' );
 222+ $text = wfMsgExt( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon', 'parsemag' );
223223 }
224224 wfProfileOut( __METHOD__ );
225225 return $text;
@@ -831,14 +831,16 @@
832832 $this->showDeletionLog();
833833 }
834834 $text = $this->getContent();
835 - if( $text === false ) {
 835+ // For now, check also for ID until getContent actually returns
 836+ // false for pages that do not exists
 837+ if( $text === false || $this->getID() === 0 ) {
836838 # Failed to load, replace text with error message
837839 $t = $this->mTitle->getPrefixedText();
838840 if( $oldid ) {
839 - $d = wfMsgExt( 'missingarticle-rev', array( 'escape' ), $oldid );
840 - $text = wfMsg( 'missing-article', $t, $d );
 841+ $d = wfMsgExt( 'missingarticle-rev', 'escape', $oldid );
 842+ $text = wfMsgExt( 'missing-article', 'parsemag', $t, $d );
841843 } else {
842 - $text = wfMsg( 'noarticletext' );
 844+ $text = wfMsgExt( 'noarticletext', 'parsemag' );
843845 }
844846 }
845847

Status & tagging log