r44052 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44051‎ | r44052 | r44053 >
Date:22:55, 29 November 2008
Author:charlie
Status:deferred
Tags:
Comment:
Fix bug 16499 reported by Alexfusco5 that caused duplicate rights to be listed if a user had the right globally and locally.
Modified paths:
  • /trunk/extensions/SharedUserRights/SharedUserRights.php (modified) (history)
  • /trunk/extensions/SharedUserRights/SharedUserRights_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SharedUserRights/SharedUserRights_body.php
@@ -264,7 +264,7 @@
265265 return false;
266266 }
267267
268 - if ( $name { 0 } == '#' ) {
 268+ if ( $name[0] == '#' ) {
269269 // Numeric ID can be specified...
270270 // We'll do a lookup for the name internally.
271271 $id = intval( substr( $name, 1 ) );
Index: trunk/extensions/SharedUserRights/SharedUserRights.php
@@ -54,7 +54,9 @@
5555 'sug_group',
5656 array ( 'sug_user' => $user->mId ) );
5757 while ( $row = $dbr->fetchObject( $res ) ) {
58 - $groups[] = $row->sug_group;
 58+ if( !in_array( $row->sug_group, $groups ) ) {
 59+ $groups[] = $row->sug_group;
 60+ }
5961 }
6062 $dbr->freeResult( $res );
6163 $dbr->selectDB( $wgDBname ); # to prevent Listusers from breaking

Status & tagging log