From: Aaron Schulz Date: Sat, 21 Apr 2007 19:02:02 +0000 (+0000) Subject: *Cascading protection notice, show regular protection and cascading notices if both... X-Git-Tag: 1.31.0-rc.0~53301 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/rappels.php?a=commitdiff_plain;h=f92dcddde4864bfb7007375a78e7d6ae5de6f6fc;p=lhc%2Fweb%2Fwiklou.git *Cascading protection notice, show regular protection and cascading notices if both apply --- diff --git a/includes/EditPage.php b/includes/EditPage.php index b0695eaa9e..5eea10ccc7 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -995,20 +995,22 @@ class EditPage { if( wfEmptyMsg( 'semiprotectedpagewarning', $notice ) || $notice == '-' ) $notice = ''; } else { - # It's either cascading protection or regular protection; work out which - list($cascadeSources, $restrictions) = $this->mTitle->getCascadeProtectionSources(); - if ( !$cascadeSources || count( $cascadeSources ) == 0 ) { - # Regular protection - $notice = wfMsg( 'protectedpagewarning' ); - } else { - # Cascading protection; explain, and list the titles responsible - $notice = wfMsg( 'cascadeprotectedwarning' ) . "\n"; - foreach( $cascadeSources as $source ) - $notice .= '* [[:' . $source->getPrefixedText() . "]]\n"; - } + # Then it must be protected based on static groups (regular) + $notice = wfMsg( 'protectedpagewarning' ); } $wgOut->addWikiText( $notice ); } + if ( $this->mTitle->isCascadeProtected() ) { + # Is this page under cascading protection from some source pages? + list($cascadeSources, $restrictions) = $this->mTitle->getCascadeProtectionSources(); + if ( count($cascadeSources) > 0 ) { + # Explain, and list the titles responsible + $notice = wfMsg( 'cascadeprotectedwarning' ) . "\n"; + foreach( $cascadeSources as $id => $page ) + $notice .= '* [[:' . $page->getPrefixedText() . "]]\n"; + } + $wgOut->addWikiText( $notice ); + } if ( $this->kblength === false ) { $this->kblength = (int)(strlen( $this->textbox1 ) / 1024);