r48983 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48982‎ | r48983 | r48984 >
Date:08:28, 29 March 2009
Author:midom
Status:reverted (Comments)
Tags:
Comment:
I'd love not to do such fixes:
* Avoid calculating expensive group error pages (this strips e.g. 25% off Special:RC)
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -1015,7 +1015,8 @@
10161016
10171017 /**
10181018 * Can $wgUser perform $action on this page?
1019 - * This skips potentially expensive cascading permission checks.
 1019+ * This skips potentially expensive cascading permission checks
 1020+ * as well as avoids expensive error formatting
10201021 *
10211022 * Suitable for use for nonessential UI controls in common cases, but
10221023 * _not_ for functional access control.
@@ -1200,8 +1201,14 @@
12011202 }
12021203 } elseif( !$user->isAllowed( $action ) ) {
12031204 $return = null;
1204 - $groups = array_map( array( 'User', 'makeGroupLinkWiki' ),
1205 - User::getGroupsWithPermission( $action ) );
 1205+
 1206+ // We avoid expensive display logic for quickUserCan's and such
 1207+ $groups = false;
 1208+ if (!$short) {
 1209+ $groups = array_map( array( 'User', 'makeGroupLinkWiki' ),
 1210+ User::getGroupsWithPermission( $action ) );
 1211+ }
 1212+
12061213 if( $groups ) {
12071214 $return = array( 'badaccess-groups',
12081215 array( implode( ', ', $groups ), count( $groups ) ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r50164Reverted r48983: obsolete since r48989, replaced by less intrusive optimisati...tstarling08:57, 4 May 2009

Comments

#Comment by Tim Starling (talk | contribs)   08:43, 4 May 2009

This seems to be obsolete since r48989, so I'm going to revert it. If it really is still needed, we can add a cache, instead of removing features and breaking things.

Status & tagging log