From 1c3eae29d7b5d42a1c74e3f9f58771c08325326a Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 13 Jun 2008 23:32:03 +0000 Subject: [PATCH] * Fix confused code * Break lone line --- includes/Article.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 2038359e96..4b6ed5abbc 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1833,11 +1833,14 @@ class Article { } $comment = $wgContLang->ucfirst( wfMsgForContent( $comment_type, $this->mTitle->getPrefixedText() ) ); - 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'] ); + # 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; + } } $cascade_description = ''; @@ -1888,7 +1891,8 @@ 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