http://www.mediawiki.org/wiki/Special:Code/MediaWiki/56340

Revision: 56340
Author:   brion
Date:     2009-09-14 21:42:28 +0000 (Mon, 14 Sep 2009)

Log Message:
-----------
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: trunk/phase3/includes/Title.php
===================================================================
--- trunk/phase3/includes/Title.php     2009-09-14 21:42:16 UTC (rev 56339)
+++ trunk/phase3/includes/Title.php     2009-09-14 21:42:28 UTC (rev 56340)
@@ -1009,7 +1009,8 @@
 
        /**
         * Can $wgUser perform $action on this page?
-        * This skips potentially expensive cascading permission checks.
+        * This skips potentially expensive cascading permission checks
+        * as well as avoids expensive error formatting
         *
         * Suitable for use for nonessential UI controls in common cases, but
         * _not_ for functional access control.
@@ -1208,8 +1209,14 @@
                        }
                } elseif( !$user->isAllowed( $action ) ) {
                        $return = null;
-                       $groups = array_map( array( 'User', 'makeGroupLinkWiki' 
),
-                               User::getGroupsWithPermission( $action ) );
+                       
+                       // We avoid expensive display logic for quickUserCan's 
and such
+                       $groups = false; 
+                       if (!$short) {
+                               $groups = array_map( array( 'User', 
'makeGroupLinkWiki' ),
+                                       User::getGroupsWithPermission( $action 
) );
+                       } 
+                       
                        if( $groups ) {
                                $return = array( 'badaccess-groups',
                                        array( implode( ', ', $groups ), count( 
$groups ) ) );



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to