Loosen requirements for cascading protection: instead of requiring that both edit...
authorRoan Kattouw <catrope@users.mediawiki.org>
Thu, 11 Dec 2008 21:37:48 +0000 (21:37 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Thu, 11 Dec 2008 21:37:48 +0000 (21:37 +0000)
RELEASE-NOTES
includes/Article.php

index e406fb1..6c1cf8a 100644 (file)
@@ -218,6 +218,8 @@ The following extensions are migrated into MediaWiki 1.14:
 * Added complimentary function for addHandler() called removeHandler() for removing events
 * Improved security of file uploads for IE clients, using a reverse-engineered 
   algorithm very similar to IE's content detection algorithm.
+* Cascading protection no longer requires that both edit and move are restricted
+  to sysop, just edit=sysop is enough
 
 === Bug fixes in 1.14 ===
 
index b2fa9b4..6a3ecae 100644 (file)
@@ -1884,13 +1884,10 @@ class Article {
 
                                # Only restrictions with the 'protect' right can cascade...
                                # Otherwise, people who cannot normally protect can "protect" pages via transclusion
-                               foreach( $limit as $action => $restriction ) {
-                                       # FIXME: can $restriction be an array or what? (same as fixme above)
-                                       if( $restriction != 'protect' && $restriction != 'sysop' ) {
-                                               $cascade = false;
-                                               break;
-                                       }
-                               }
+                               $editrestriction = isset( $limit['edit'] ) ? array( $limit['edit'] ) : $this->mTitle->getRestrictions( 'edit' );
+                               # The schema allows multiple restrictions
+                               if(!in_array('protect', $editrestriction) && !in_array('sysop', $editrestriction))
+                                       $cascade = false;
                                $cascade_description = '';       
                                if( $cascade ) {
                                        $cascade_description = ' ['.wfMsgForContent('protect-summary-cascade').']';