Merge "Unbreak cascading protection"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 9 Jul 2013 20:25:47 +0000 (20:25 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 9 Jul 2013 20:25:47 +0000 (20:25 +0000)
1  2 
includes/WikiPage.php

diff --combined includes/WikiPage.php
@@@ -2071,9 -2071,7 +2071,9 @@@ class WikiPage implements Page, IDBAcce
  
                // Update the links tables and other secondary data
                if ( $content ) {
 -                      $updates = $content->getSecondaryDataUpdates( $this->getTitle(), null, true, $editInfo->output );
 +                      $recursive = $options['changed']; // bug 50785
 +                      $updates = $content->getSecondaryDataUpdates(
 +                              $this->getTitle(), null, $recursive, $editInfo->output );
                        DataUpdate::runUpdates( $updates );
                }
  
                        // Only certain restrictions can cascade... Otherwise, users who cannot normally protect pages
                        // could "protect" them by transcluding them on protected pages they are allowed to edit.
                        $editrestriction = isset( $limit['edit'] ) ? array( $limit['edit'] ) : $this->mTitle->getRestrictions( 'edit' );
+                       foreach ( array_keys( $editrestriction, 'sysop' ) as $key ) {
+                               $editrestriction[$key] = 'editprotected'; // backwards compatibility
+                       }
+                       foreach ( array_keys( $editrestriction, 'autoconfirmed' ) as $key ) {
+                               $editrestriction[$key] = 'editsemiprotected'; // backwards compatibility
+                       }
  
                        $cascadingRestrictionLevels = $wgCascadingRestrictionLevels;
                        foreach ( array_keys( $cascadingRestrictionLevels, 'sysop' ) as $key ) {