r78398 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78397‎ | r78398 | r78399 >
Date:19:40, 14 December 2010
Author:ialex
Status:ok
Tags:
Comment:
Checking permissions for $wgUser while doing an edit with another user is not a good idea
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -2183,7 +2183,8 @@
21842184 # Update recentchanges
21852185 if ( !( $flags & EDIT_SUPPRESS_RC ) ) {
21862186 # Mark as patrolled if the user can do so
2187 - $patrolled = $wgUseRCPatrol && $this->mTitle->userCan( 'autopatrol' );
 2187+ $patrolled = $wgUseRCPatrol && !count(
 2188+ $this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
21882189 # Add RC row to the DB
21892190 $rc = RecentChange::notifyEdit( $now, $this->mTitle, $isminor, $user, $summary,
21902191 $this->mLatest, $this->getTimestamp(), $bot, '', $oldsize, $newsize,
@@ -2271,7 +2272,8 @@
22722273 global $wgUseRCPatrol, $wgUseNPPatrol;
22732274
22742275 # Mark as patrolled if the user can do so
2275 - $patrolled = ( $wgUseRCPatrol || $wgUseNPPatrol ) && $this->mTitle->userCan( 'autopatrol' );
 2276+ $patrolled = ( $wgUseRCPatrol || $wgUseNPPatrol ) && !count(
 2277+ $this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
22762278 # Add RC row to the DB
22772279 $rc = RecentChange::notifyNew( $now, $this->mTitle, $isminor, $user, $summary, $bot,
22782280 '', strlen( $text ), $revisionId, $patrolled );

Status & tagging log