r99585 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99584‎ | r99585 | r99586 >
Date:22:16, 11 October 2011
Author:robin
Status:ok (Comments)
Tags:
Comment:
(Bug 31616) Update call of User::getGroupMember on Special:CheckUser
Modified paths:
  • /trunk/extensions/CheckUser/CheckUser_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CheckUser/CheckUser_body.php
@@ -1018,7 +1018,7 @@
10191019 }
10201020 $list = array();
10211021 foreach ( $user->getGroups() as $group ) {
1022 - $list[] = self::buildGroupLink( $group );
 1022+ $list[] = self::buildGroupLink( $group, $user->getName() );
10231023 }
10241024 $groups = $wgLang->commaList( $list );
10251025 if ( $groups ) {
@@ -1267,12 +1267,13 @@
12681268 * Format a link to a group description page
12691269 *
12701270 * @param string $group
 1271+ * @param string $username
12711272 * @return string
12721273 */
1273 - protected static function buildGroupLink( $group ) {
 1274+ protected static function buildGroupLink( $group, $username = '#' ) {
12741275 static $cache = array();
12751276 if ( !isset( $cache[$group] ) ) {
1276 - $cache[$group] = User::makeGroupLinkHtml( $group, User::getGroupMember( $group ) );
 1277+ $cache[$group] = User::makeGroupLinkHtml( $group, User::getGroupMember( $group, $username ) );
12771278 }
12781279 return $cache[$group];
12791280 }

Comments

#Comment by Duplicatebug (talk | contribs)   18:57, 14 October 2011

I am not sure, but now the cache can contains male or/and female items (depends on the user), that sounds bad.

Status & tagging log