From: Aaron Schulz Date: Wed, 28 Jan 2009 23:55:17 +0000 (+0000) Subject: Use quickUserCan() at some possible performance hotspots (rollback links). Unlikely... X-Git-Tag: 1.31.0-rc.0~43151 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=8794e3f68f477ac781e953a1d53b8efac112e94d;p=lhc%2Fweb%2Fwiklou.git Use quickUserCan() at some possible performance hotspots (rollback links). Unlikely for anyone to notice anything except maybe getting a permission error once every blue moon. --- diff --git a/includes/ChangesList.php b/includes/ChangesList.php index cc9c358d76..629211e2c0 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -326,8 +326,8 @@ class ChangesList { $page = $rc->getTitle(); /** Check for rollback and edit permissions, disallow special pages, and only * show a link on the top-most revision */ - if( $rc->mAttribs['rc_cur_id'] > 0 && $page->userCan('rollback') && $page->userCan('edit') - && $page->getLatestRevID() == $rc->mAttribs['rc_this_oldid'] ) + if( $rc->mAttribs['rc_cur_id'] && $page->getLatestRevID() == $rc->mAttribs['rc_this_oldid'] + && $page->quickUserCan('rollback') && $page->quickUserCan('edit') ) { $rev = new Revision( array( 'id' => $rc->mAttribs['rc_this_oldid'], diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 5723dafe3f..b96a9d7ea2 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -485,7 +485,7 @@ class ContribsPager extends ReverseChronologicalPager { if( !$row->page_is_new ) { $difftext .= '(' . $sk->makeKnownLinkObj( $page, $this->messages['diff'], 'diff=0' ) . ')'; # Add rollback link - if( $page->userCan( 'rollback') && $page->userCan( 'edit' ) ) { + if( $page->quickUserCan( 'rollback') && $page->quickUserCan( 'edit' ) ) { $topmarktext .= ' '.$sk->generateRollback( $rev ); } } else {