From 9cb3299aee7acc5ba824427146e9f4c77e325ede Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 14 Dec 2010 19:40:27 +0000 Subject: [PATCH] Checking permissions for $wgUser while doing an edit with another user is not a good idea --- includes/Article.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 ); -- 2.20.1