From 7409fde6048e7868e3e33b24691a8257ae5d4e6f Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 31 Dec 2008 21:16:36 +0000 Subject: [PATCH] Revert r45166 "Use quickUserCan for UI links" Use of quickUserCan should be minimized to cases where maximal view speed is more important than accuracy, such as UI that's plastered on every page view. In page history we're already headed into editor territory, and having an accurate idea of what we can do with editing tools (such as rollback) is relatively important. Unless it can be shown that checking for cascading protections is a serious problem for site performance, we should continue using accurate checks here. --- includes/PageHistory.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 5fd81b32f7..b01b485e68 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -331,16 +331,14 @@ class PageHistory { } $tools = array(); + if( !is_null( $next ) && is_object( $next ) ) { - # Add [rollback] link to current revision - if( $latest && $this->mTitle->quickUserCan( 'rollback' ) && - $this->mTitle->quickUserCan( 'edit' ) ) - { + if( $latest && $this->mTitle->userCan( 'rollback' ) && $this->mTitle->userCan( 'edit' ) ) { $tools[] = ''.$this->mSkin->buildRollbackLink( $rev ).''; } - # Add (undo) links to revisions + if( $this->mTitle->quickUserCan( 'edit' ) && !$rev->isDeleted( Revision::DELETED_TEXT ) && - !($next->rev_deleted & Revision::DELETED_TEXT) ) + !$next->rev_deleted & Revision::DELETED_TEXT ) { # Create undo tooltip for the first (=latest) line only $undoTooltip = $latest -- 2.20.1