From acbb8111fbf4eb821777cb95e666507e69a8fad5 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 21 Sep 2008 09:47:46 +0000 Subject: [PATCH] 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. --- RELEASE-NOTES | 1 - includes/Article.php | 23 +++++------------------ 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b8b6887f57..6d40652e81 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/Article.php b/includes/Article.php index cc409482a5..eeff834474 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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 "
\n$ret\n
"; + $ret = wfMsgWeirdKey ( $this->mTitle->getText() ) ; } else { - return $this->getNoSuchPageText(); + $ret = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ); } + + return "
\n$ret\n
"; } 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 "
\n$text\n
"; - } - /** * This function returns the text of a section, specified by a number ($section). * A section is text under a heading like == Heading == or \Heading\, or -- 2.20.1