From f6e14da30935bc223d23f0eff90e0d8ec6e4ed50 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 29 Dec 2008 22:24:31 +0000 Subject: [PATCH] Use quickUserCan for UI links --- includes/PageHistory.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/PageHistory.php b/includes/PageHistory.php index b01b485e68..5fd81b32f7 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -331,14 +331,16 @@ class PageHistory { } $tools = array(); - if( !is_null( $next ) && is_object( $next ) ) { - if( $latest && $this->mTitle->userCan( 'rollback' ) && $this->mTitle->userCan( 'edit' ) ) { + # Add [rollback] link to current revision + if( $latest && $this->mTitle->quickUserCan( 'rollback' ) && + $this->mTitle->quickUserCan( '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