From: Alexandre Emsenhuber Date: Sat, 14 Jul 2012 19:30:49 +0000 (+0200) Subject: For consistency of the interface, don't do expensive checks on page view. X-Git-Tag: 1.31.0-rc.0~23039 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=22f10ef350b2d5cae6a4a0459acbaee5c28d098f;p=lhc%2Fweb%2Fwiklou.git 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 --- 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() ) . '';