From: Alexandre Emsenhuber Date: Tue, 14 Dec 2010 19:40:27 +0000 (+0000) Subject: Checking permissions for $wgUser while doing an edit with another user is not a good... X-Git-Tag: 1.31.0-rc.0~33297 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=9cb3299aee7acc5ba824427146e9f4c77e325ede;p=lhc%2Fweb%2Fwiklou.git Checking permissions for $wgUser while doing an edit with another user is not a good idea --- diff --git a/includes/Article.php b/includes/Article.php index 35ab2eb56b..a01f40cb7c 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2183,7 +2183,8 @@ class Article { # Update recentchanges if ( !( $flags & EDIT_SUPPRESS_RC ) ) { # Mark as patrolled if the user can do so - $patrolled = $wgUseRCPatrol && $this->mTitle->userCan( 'autopatrol' ); + $patrolled = $wgUseRCPatrol && !count( + $this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) ); # Add RC row to the DB $rc = RecentChange::notifyEdit( $now, $this->mTitle, $isminor, $user, $summary, $this->mLatest, $this->getTimestamp(), $bot, '', $oldsize, $newsize, @@ -2271,7 +2272,8 @@ class Article { global $wgUseRCPatrol, $wgUseNPPatrol; # Mark as patrolled if the user can do so - $patrolled = ( $wgUseRCPatrol || $wgUseNPPatrol ) && $this->mTitle->userCan( 'autopatrol' ); + $patrolled = ( $wgUseRCPatrol || $wgUseNPPatrol ) && !count( + $this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) ); # Add RC row to the DB $rc = RecentChange::notifyNew( $now, $this->mTitle, $isminor, $user, $summary, $bot, '', strlen( $text ), $revisionId, $patrolled );