*If a page is protected and cascade protected, use regular edit page notice (bug...
authorAaron Schulz <aaron@users.mediawiki.org>
Fri, 23 Mar 2007 19:20:53 +0000 (19:20 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Fri, 23 Mar 2007 19:20:53 +0000 (19:20 +0000)
includes/EditPage.php

index 2eabfda..94f7499 100644 (file)
@@ -994,14 +994,14 @@ class EditPage {
                        } 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 );