r53184 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53183‎ | r53184 | r53185 >
Date:17:27, 13 July 2009
Author:aaron
Status:ok
Tags:
Comment:
optimized onUserCan() a bit
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -644,11 +644,11 @@
645645 * Check page move and patrol permissions for FlaggedRevs
646646 */
647647 public static function onUserCan( $title, $user, $action, &$result ) {
648 - if( $result === false || !$title->exists() )
 648+ if( $result === false )
649649 return true; // nothing to do
650650 # Don't let users vandalize pages by moving them...
651651 if( $action === 'move' ) {
652 - if( !FlaggedRevs::isPageReviewable($title) )
 652+ if( !FlaggedRevs::isPageReviewable($title) || !$title->exists() )
653653 return true;
654654 $flaggedArticle = FlaggedArticle::getTitleInstance( $title );
655655 # If the current shows be default anyway, nothing to do...

Status & tagging log