From c0d6b5adf924e9dbc90a8d8dcdb1f9178166c883 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 11 Apr 2006 08:27:35 +0000 Subject: [PATCH] * Display the anon talk page info message on anon talk pages again (moved outside the parser cache) Saving the parser cache along with the page save broke the old way this message was added. It's not added on view, rather than on content fetch, which should be more reliable. It will also allow the message to update properly. However it may cause double display on old-parsercached items. Oh wells. --- RELEASE-NOTES | 3 +++ includes/Article.php | 41 +++++++++++++++++++---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c61a020f65..e4e1dd887f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -41,6 +41,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 5499) Don't clear the tag strip state when asked not to clear state. Fixes regression with use of in a template breaking etc. * Minor grammatical improvements in English language files +* Display the anon talk page info message on anon talk pages again + (moved outside the parser cache) + == Compatibility == diff --git a/includes/Article.php b/includes/Article.php index 1f83a2e2ca..4ede20f3ec 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -175,32 +175,23 @@ class Article { return "
$ret
"; } else { $this->loadContent(); - # check if we're displaying a [[User talk:x.x.x.x]] anonymous talk page - if ( $this->mTitle->getNamespace() == NS_USER_TALK && - $wgUser->isIP($this->mTitle->getText()) && - $action=='view' - ) { - wfProfileOut( $fname ); - return $this->mContent . "\n" .wfMsg('anontalkpagetext'); - } else { - if($action=='edit') { - if($section!='') { - if($section=='new') { - wfProfileOut( $fname ); - $text=$this->getPreloadedText($preload); - return $text; - } - - # strip NOWIKI etc. to avoid confusion (true-parameter causes HTML - # comments to be stripped as well) - $rv=$this->getSection($this->mContent,$section); + if($action=='edit') { + if($section!='') { + if($section=='new') { wfProfileOut( $fname ); - return $rv; + $text=$this->getPreloadedText($preload); + return $text; } + + # strip NOWIKI etc. to avoid confusion (true-parameter causes HTML + # comments to be stripped as well) + $rv=$this->getSection($this->mContent,$section); + wfProfileOut( $fname ); + return $rv; } - wfProfileOut( $fname ); - return $this->mContent; } + wfProfileOut( $fname ); + return $this->mContent; } } @@ -923,6 +914,12 @@ class Article { if( empty( $t ) ) { $wgOut->setPageTitle( $this->mTitle->getPrefixedText() ); } + + # check if we're displaying a [[User talk:x.x.x.x]] anonymous talk page + if( $this->mTitle->getNamespace() == NS_USER_TALK && + User::isIP( $this->mTitle->getText() ) ) { + $wgOut->addWikiText( wfMsg('anontalkpagetext') ); + } # If we have been passed an &rcid= parameter, we want to give the user a # chance to mark this new article as patrolled. -- 2.20.1