r56020 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56019‎ | r56020 | r56021 >
Date:09:03, 8 September 2009
Author:aaron
Status:ok
Tags:
Comment:
minor cleanups
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php
@@ -351,7 +351,7 @@
352352 array( 'fpc_page_id' => $this->page->getArticleID() ),
353353 __METHOD__
354354 );
355 - # If setting to site default values, erase the row if there is one...
 355+ # If setting to site default values and there is a row...erase it
356356 if( $row && $reset ) {
357357 $dbw->delete( 'flaggedpage_config',
358358 array( 'fpc_page_id' => $this->page->getArticleID() ),
@@ -360,9 +360,12 @@
361361 # Otherwise, add a row unless we are just setting it as the site default,
362362 # or it is the same the current one...
363363 } elseif( !$reset ) {
364 - if( !$row || $row->fpc_select != $this->select || $row->fpc_override != $this->override
365 - || $row->fpc_level != $this->autoreview || $row->fpc_expiry != $expiry )
366 - {
 364+ if( !$row // no previous config, or...
 365+ || $row->fpc_select != $this->select // ...precedence changed, or...
 366+ || $row->fpc_override != $this->override // ...override changed, or...
 367+ || $row->fpc_level != $this->autoreview // ...autoreview level changed, or...
 368+ || $row->fpc_expiry != $expiry // ...expiry changed
 369+ ) {
367370 $changed = true;
368371 $dbw->replace( 'flaggedpage_config',
369372 array( 'PRIMARY' ),
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -766,9 +766,10 @@
767767 # Get autoreview restriction settings...
768768 $config = FlaggedRevs::getPageVisibilitySettings( $title, true );
769769 # Convert Sysop -> protect
770 - $right = ($config['autoreview'] === 'sysop') ? 'protect' : $config['autoreview'];
 770+ $right = ($config['autoreview'] === 'sysop') ?
 771+ 'protect' : $config['autoreview'];
771772 # Check if the user has the required right, if any
772 - $isAllowed = !$right || $user->isAllowed($right);
 773+ $isAllowed = ($right == '' || $user->isAllowed($right));
773774 }
774775 # Auto-reviewing must be enabled and user must have the required permissions
775776 if( !$isAllowed ) {

Status & tagging log