} else {
# It's either cascading protection or regular protection; work out which
list($cascadeSources, $restrictions) = $this->mTitle->getCascadeProtectionSources();
- if( $cascadeSources && count( $cascadeSources ) > 0 ) {
+ 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";
- } else {
- # Regular protection
- $notice = wfMsg( 'protectedpagewarning' );
}
}
$wgOut->addWikiText( $notice );