Index: trunk/phase3/includes/Title.php |
— | — | @@ -1009,7 +1009,8 @@ |
1010 | 1010 | |
1011 | 1011 | /** |
1012 | 1012 | * 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 |
1014 | 1015 | * |
1015 | 1016 | * Suitable for use for nonessential UI controls in common cases, but |
1016 | 1017 | * _not_ for functional access control. |
— | — | @@ -1208,8 +1209,14 @@ |
1209 | 1210 | } |
1210 | 1211 | } elseif( !$user->isAllowed( $action ) ) { |
1211 | 1212 | $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 | + |
1214 | 1221 | if( $groups ) { |
1215 | 1222 | $return = array( 'badaccess-groups', |
1216 | 1223 | array( implode( ', ', $groups ), count( $groups ) ) ); |