Title::getRestrictions can return "sysop", which will not match if
replaced out of $cascadingRestrictionLevels but not $editrestriction,
making it impossible to cascade protect a page with the default value
of $wgCascadingRestrictionLevels.
Follows-up I6bf650a3fbdab8589ae6945c8c916eafd949e41c.
Change-Id: Ie7183ed9509ea9c65a7197fc9cead6c8423b852e
// 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 ) {