r36472 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36471‎ | r36472 | r36473 >
Date:18:00, 19 June 2008
Author:brion
Status:old
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -1835,14 +1835,11 @@
18361836 }
18371837 $comment = $wgContLang->ucfirst( wfMsgForContent( $comment_type, $this->mTitle->getPrefixedText() ) );
18381838
1839 - # Only restrictions with the 'protect' right can cascade...
1840 - # Otherwise, people who cannot normally protect can "protect" pages via transclusion
1841 - foreach( $limit as $action => $restriction ) {
1842 - # FIXME: can $restriction be an array or what? (same as fixme above)
1843 - if( $restriction != 'protect' && $restriction != 'sysop' ) {
1844 - $cascade = false;
1845 - break;
1846 - }
 1839+ foreach( $limit as $action => $restrictions ) {
 1840+ # Check if the group level required to edit also can protect pages
 1841+ # Otherwise, people who cannot normally protect can "protect" pages via transclusion
 1842+ $cascade = ( $cascade && isset($wgGroupPermissions[$restrictions]['protect']) &&
 1843+ $wgGroupPermissions[$restrictions]['protect'] );
18471844 }
18481845
18491846 $cascade_description = '';
@@ -1893,8 +1890,7 @@
18941891 # Update the protection log
18951892 $log = new LogPage( 'protect' );
18961893 if( $protect ) {
1897 - $log->addEntry( $modified ? 'modify' : 'protect', $this->mTitle,
1898 - trim( $reason . " [$updated]$cascade_description$expiry_description" ) );
 1894+ $log->addEntry( $modified ? 'modify' : 'protect', $this->mTitle, trim( $reason . " [$updated]$cascade_description$expiry_description" ) );
18991895 } else {
19001896 $log->addEntry( 'unprotect', $this->mTitle, $reason );
19011897 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r36273* Fix confused code...aaron23:32, 13 June 2008

Status & tagging log