From 406a143dfe28e4eddc077893c43cc8423c87ed6f Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 8 Aug 2008 21:56:58 +0000 Subject: [PATCH] Revert r38879, 38880 "(bug 14002) Change cascade protection warning message to be consistent with cascade-protection 'blocked' message." Incompatible change to message, and just seems kind of ugly. It's usually easier to maintain the core message without having to remember to slap "and the bit that always follows it" on the end every time. Probably the other message referred to should be fixed to follow general conventions, rather than this one changed to break them. :) --- includes/EditPage.php | 11 +++++++---- languages/messages/MessagesEn.php | 3 +-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 4406838c5b..160e0f1a89 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1151,11 +1151,14 @@ class EditPage { if ( $this->mTitle->isCascadeProtected() ) { # Is this page under cascading protection from some source pages? list($cascadeSources, /* $restrictions */) = $this->mTitle->getCascadeProtectionSources(); - $notice = ""; - foreach( $cascadeSources as $page ) { - $notice .= '* [[:' . $page->getPrefixedText() . "]]\n"; + $notice = "$1\n"; + if ( count($cascadeSources) > 0 ) { + # Explain, and list the titles responsible + foreach( $cascadeSources as $page ) { + $notice .= '* [[:' . $page->getPrefixedText() . "]]\n"; + } } - $wgOut->addWikiMsg( 'cascadeprotectedwarning', count($cascadeSources), $notice ); + $wgOut->wrapWikiMsg( $notice, array( 'cascadeprotectedwarning', count($cascadeSources) ) ); } if( !$this->mTitle->exists() && $this->mTitle->getRestrictions( 'create' ) != array() ){ $wgOut->addWikiMsg( 'titleprotectedwarning' ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 8c0e2ba6a6..dc93385372 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1150,8 +1150,7 @@ It cannot be saved.', You may wish to cut-n-paste the text into a text file and save it for later.', 'protectedpagewarning' => 'WARNING: This page has been locked so that only users with sysop privileges can edit it.', 'semiprotectedpagewarning' => "'''Note:''' This page has been locked so that only registered users can edit it.", -'cascadeprotectedwarning' => "'''Warning:''' This page has been locked so that only users with sysop privileges can edit it, because it is included in the following cascade-protected {{PLURAL:$1|page|pages}}: -$2", +'cascadeprotectedwarning' => "'''Warning:''' This page has been locked so that only users with sysop privileges can edit it, because it is included in the following cascade-protected {{PLURAL:$1|page|pages}}:", 'titleprotectedwarning' => 'WARNING: This page has been locked so that only some users can create it.', 'templatesused' => 'Templates used on this page:', 'templatesusedpreview' => 'Templates used in this preview:', -- 2.20.1