Revert r41095, the bug is there because giving an error message as the return value from Article::getContent() is a terrible hack which should never have been allowed to survive this long. Move this crap to Article::view() or something.

This commit is contained in:
Tim Starling 2008-09-21 09:47:46 +00:00
parent 9f84a2fe83
commit acbb8111fb
2 changed files with 5 additions and 19 deletions

View file

@ -213,7 +213,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
has been blocked more than 10 times. Patch by Matt Johnston.
* (bug 12678) Skins don't show Upload link if the user isn't allowed to upload.
* Fixed incorrect usage of DB_LAST in Special:Export. Deprecated DB_LAST.
* 11119 {{grammar}} broken in noarticletext(anon) when ui lang != content lang
=== API changes in 1.14 ===

View file

@ -210,7 +210,7 @@ class Article {
* @return Return the text of this revision
*/
function getContent() {
global $wgOut, $wgMessageCache;
global $wgUser, $wgOut, $wgMessageCache;
wfProfileIn( __METHOD__ );
@ -220,11 +220,12 @@ class Article {
if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
$wgMessageCache->loadAllMessages();
$ret = wfMsgWeirdKey( $this->mTitle->getText() );
return "<div class='noarticletext'>\n$ret\n</div>";
$ret = wfMsgWeirdKey ( $this->mTitle->getText() ) ;
} else {
return $this->getNoSuchPageText();
$ret = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' );
}
return "<div class='noarticletext'>\n$ret\n</div>";
} else {
$this->loadContent();
wfProfileOut( __METHOD__ );
@ -232,20 +233,6 @@ class Article {
}
}
/*
* HACK HACK! We pre-parse them with parsemag to get GRAMMAR working right.
* It should be safe to do this and then do the full parse.
*/
function getNoSuchPageText() {
global $wgUser;
if ( $wgUser->isLoggedIn() ) {
$text = wfMsgExt( 'noarticletext', 'parsemag' );
} else {
$text = wfMsgExt( 'noarticletextanon', 'parsemag' );
}
return "<div class='noarticletext'>\n$text\n</div>";
}
/**
* This function returns the text of a section, specified by a number ($section).
* A section is text under a heading like == Heading == or \<h1\>Heading\</h1\>, or