From 0d4586294987d4b64afd787499fc5d0aaf81105c Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 19 Jun 2008 18:00:22 +0000 Subject: [PATCH] Revert r36273: The change was described only as "Fix confused code", but it changed from something that appears to make sense (check for a permission key for that restriction group) to something that doesn't (hardcoded check for two particular names). If the change has an effect, and there's a reason for it, please describe it in a bit more detail. --- includes/Article.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index bce720233a..bce69c8f3e 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1835,14 +1835,11 @@ class Article { } $comment = $wgContLang->ucfirst( wfMsgForContent( $comment_type, $this->mTitle->getPrefixedText() ) ); - # 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; - } + foreach( $limit as $action => $restrictions ) { + # Check if the group level required to edit also can protect pages + # Otherwise, people who cannot normally protect can "protect" pages via transclusion + $cascade = ( $cascade && isset($wgGroupPermissions[$restrictions]['protect']) && + $wgGroupPermissions[$restrictions]['protect'] ); } $cascade_description = ''; @@ -1893,8 +1890,7 @@ class Article { # Update the protection log $log = new LogPage( 'protect' ); if( $protect ) { - $log->addEntry( $modified ? 'modify' : 'protect', $this->mTitle, - trim( $reason . " [$updated]$cascade_description$expiry_description" ) ); + $log->addEntry( $modified ? 'modify' : 'protect', $this->mTitle, trim( $reason . " [$updated]$cascade_description$expiry_description" ) ); } else { $log->addEntry( 'unprotect', $this->mTitle, $reason ); } -- 2.20.1