From d726e2d29cf9e3b127e0cbdc53fb9120c371e363 Mon Sep 17 00:00:00 2001 From: Ilmari Karonen Date: Thu, 11 Jan 2007 04:13:11 +0000 Subject: [PATCH] make default system messages show on "view source" --- includes/EditPage.php | 11 +++++++---- includes/OutputPage.php | 13 +++---------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 0d03b6c766..a3ed161d0f 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -81,10 +81,13 @@ class EditPage { $text = ''; if( !$this->mTitle->exists() ) { - - # If requested, preload some text. - $text = $this->getPreloadedText( $preload ); - + if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { + # If this is a system message, get the default text. + $text = wfMsgWeirdKey ( $this->mTitle->getText() ) ; + } else { + # If requested, preload some text. + $text = $this->getPreloadedText( $preload ); + } # We used to put MediaWiki:Newarticletext here if # $text was empty at this point. # This is now shown above the edit box instead. diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 2636d8bb68..085d5f210d 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -886,6 +886,8 @@ class OutputPage { global $wgUser, $wgReadOnlyFile, $wgReadOnly, $wgTitle; $skin = $wgUser->getSkin(); + error_log("readOnlyPage( '$source', '$protected')\n"); + $this->setRobotpolicy( 'noindex,nofollow' ); $this->setArticleRelated( false ); @@ -895,7 +897,7 @@ class OutputPage { # Determine if protection is due to the page being a system message # and show an appropriate explanation - if( $wgTitle->getNamespace() == NS_MEDIAWIKI && !$wgUser->isAllowed( 'editinterface' ) ) { + if( $wgTitle->getNamespace() == NS_MEDIAWIKI ) { $this->addWikiText( wfMsg( 'protectedinterface' ) ); } else { $this->addWikiText( wfMsg( 'protectedpagetext' ) ); @@ -912,17 +914,8 @@ class OutputPage { if( is_string( $source ) ) { $this->addWikiText( wfMsg( 'viewsourcetext' ) ); - if( $source === '' ) { - global $wgTitle; - if ( $wgTitle->getNamespace() == NS_MEDIAWIKI ) { - $source = wfMsgWeirdKey ( $wgTitle->getText() ); - } else { - $source = ''; - } - } $rows = $wgUser->getIntOption( 'rows' ); $cols = $wgUser->getIntOption( 'cols' ); - $text = "\n"; $this->addHTML( $text ); -- 2.20.1