From 22f10ef350b2d5cae6a4a0459acbaee5c28d098f Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 14 Jul 2012 21:30:49 +0200 Subject: [PATCH] For consistency of the interface, don't do expensive checks on page view. Also replaced two $this->getUser() calls with $user since that variable is already in that method. Change-Id: Iccda9f44a9cf6d3187895a8b6111bc62dca1e811 --- includes/actions/HistoryAction.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index 73933157d0..1dacabc490 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -618,10 +618,8 @@ class HistoryPager extends ReverseChronologicalPager { $tools = array(); # Rollback and undo links - if ( $prevRev && - !count( $this->getTitle()->getUserPermissionsErrors( 'edit', $this->getUser() ) ) ) - { - if ( $latest && !count( $this->getTitle()->getUserPermissionsErrors( 'rollback', $this->getUser() ) ) ) { + if ( $prevRev && $this->getTitle()->quickUserCan( 'edit', $user ) ) { + if ( $latest && $this->getTitle()->quickUserCan( 'rollback', $user ) ) { $this->preventClickjacking(); $tools[] = '' . Linker::buildRollbackLink( $rev, $this->getContext() ) . ''; -- 2.20.1