From: Niklas Laxström Date: Mon, 12 Jan 2009 08:11:22 +0000 (+0000) Subject: brr, Article::getContent still has "side effects" X-Git-Tag: 1.31.0-rc.0~43456 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22sites_tous%22%29%20.%20%22?a=commitdiff_plain;h=b50935d3bf48e4fffdf22011a888e5e345b2c4b8;p=lhc%2Fweb%2Fwiklou.git brr, Article::getContent still has "side effects" --- diff --git a/includes/Article.php b/includes/Article.php index 5d91a432e5..c4135c37b4 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -218,7 +218,7 @@ class Article { if( wfEmptyMsg( $message, $text ) ) $text = ''; } else { - $text = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ); + $text = wfMsgExt( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon', 'parsemag' ); } wfProfileOut( __METHOD__ ); return $text; @@ -831,14 +831,16 @@ class Article { $this->showDeletionLog(); } $text = $this->getContent(); - if( $text === false ) { + // For now, check also for ID until getContent actually returns + // false for pages that do not exists + if( $text === false || $this->getID() === 0 ) { # Failed to load, replace text with error message $t = $this->mTitle->getPrefixedText(); if( $oldid ) { - $d = wfMsgExt( 'missingarticle-rev', array( 'escape' ), $oldid ); - $text = wfMsg( 'missing-article', $t, $d ); + $d = wfMsgExt( 'missingarticle-rev', 'escape', $oldid ); + $text = wfMsgExt( 'missing-article', 'parsemag', $t, $d ); } else { - $text = wfMsg( 'noarticletext' ); + $text = wfMsgExt( 'noarticletext', 'parsemag' ); } }