Index: trunk/phase3/includes/Title.php |
— | — | @@ -1015,7 +1015,8 @@ |
1016 | 1016 | |
1017 | 1017 | /** |
1018 | 1018 | * 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 |
1020 | 1021 | * |
1021 | 1022 | * Suitable for use for nonessential UI controls in common cases, but |
1022 | 1023 | * _not_ for functional access control. |
— | — | @@ -1200,8 +1201,14 @@ |
1201 | 1202 | } |
1202 | 1203 | } elseif( !$user->isAllowed( $action ) ) { |
1203 | 1204 | $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 | + |
1206 | 1213 | if( $groups ) { |
1207 | 1214 | $return = array( 'badaccess-groups', |
1208 | 1215 | array( implode( ', ', $groups ), count( $groups ) ) ); |