r56340 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56339‎ | r56340 | r56341 >
Date:21:42, 14 September 2009
Author:brion
Status:ok
Tags:
Comment:
Merge live hack from wmf-deployment r53208: skip calculation of display names for groups in permission errors when we're only checking for a yes/no
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -1009,7 +1009,8 @@
10101010
10111011 /**
10121012 * Can $wgUser perform $action on this page?
1013 - * This skips potentially expensive cascading permission checks.
 1013+ * This skips potentially expensive cascading permission checks
 1014+ * as well as avoids expensive error formatting
10141015 *
10151016 * Suitable for use for nonessential UI controls in common cases, but
10161017 * _not_ for functional access control.
@@ -1208,8 +1209,14 @@
12091210 }
12101211 } elseif( !$user->isAllowed( $action ) ) {
12111212 $return = null;
1212 - $groups = array_map( array( 'User', 'makeGroupLinkWiki' ),
1213 - User::getGroupsWithPermission( $action ) );
 1213+
 1214+ // We avoid expensive display logic for quickUserCan's and such
 1215+ $groups = false;
 1216+ if (!$short) {
 1217+ $groups = array_map( array( 'User', 'makeGroupLinkWiki' ),
 1218+ User::getGroupsWithPermission( $action ) );
 1219+ }
 1220+
12141221 if( $groups ) {
12151222 $return = array( 'badaccess-groups',
12161223 array( implode( ', ', $groups ), count( $groups ) ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r56374Merge post-branch trunk updates replacing old live hacks:...brion17:25, 15 September 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r53208Apply live hacks, local merges, and removal of SVN externals -- all copied fr...brion23:50, 13 July 2009

Status & tagging log