r36273 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36272‎ | r36273 | r36274 >
Date:23:32, 13 June 2008
Author:aaron
Status:old
Tags:
Comment:
* Fix confused code
* Break lone line
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -1833,11 +1833,14 @@
18341834 }
18351835 $comment = $wgContLang->ucfirst( wfMsgForContent( $comment_type, $this->mTitle->getPrefixedText() ) );
18361836
1837 - foreach( $limit as $action => $restrictions ) {
1838 - # Check if the group level required to edit also can protect pages
1839 - # Otherwise, people who cannot normally protect can "protect" pages via transclusion
1840 - $cascade = ( $cascade && isset($wgGroupPermissions[$restrictions]['protect']) &&
1841 - $wgGroupPermissions[$restrictions]['protect'] );
 1837+ # Only restrictions with the 'protect' right can cascade...
 1838+ # Otherwise, people who cannot normally protect can "protect" pages via transclusion
 1839+ foreach( $limit as $action => $restriction ) {
 1840+ # FIXME: can $restriction be an array or what? (same as fixme above)
 1841+ if( $restriction != 'protect' && $restriction != 'sysop' ) {
 1842+ $cascade = false;
 1843+ break;
 1844+ }
18421845 }
18431846
18441847 $cascade_description = '';
@@ -1888,7 +1891,8 @@
18891892 # Update the protection log
18901893 $log = new LogPage( 'protect' );
18911894 if( $protect ) {
1892 - $log->addEntry( $modified ? 'modify' : 'protect', $this->mTitle, trim( $reason . " [$updated]$cascade_description$expiry_description" ) );
 1895+ $log->addEntry( $modified ? 'modify' : 'protect', $this->mTitle,
 1896+ trim( $reason . " [$updated]$cascade_description$expiry_description" ) );
18931897 } else {
18941898 $log->addEntry( 'unprotect', $this->mTitle, $reason );
18951899 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r36472Revert r36273:...brion18:00, 19 June 2008
r36519* Revert r36478; I don't see the point in this cryptic code...aaron03:17, 21 June 2008

Status & tagging log