From: Alexandre Emsenhuber Date: Wed, 29 Jul 2009 08:43:40 +0000 (+0000) Subject: Fix for r53757 per Nikerabbit's comment: these can also be "true", only do array_uniq... X-Git-Tag: 1.31.0-rc.0~40652 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=3d984645036b365d03871435454a43ec2086b4af;p=lhc%2Fweb%2Fwiklou.git Fix for r53757 per Nikerabbit's comment: these can also be "true", only do array_unique() if they're array --- diff --git a/includes/specials/SpecialListgrouprights.php b/includes/specials/SpecialListgrouprights.php index ea76ea9509..642577f151 100644 --- a/includes/specials/SpecialListgrouprights.php +++ b/includes/specials/SpecialListgrouprights.php @@ -126,12 +126,6 @@ class SpecialListGroupRights extends SpecialPage { private static function formatPermissions( $permissions, $revoke, $add, $remove, $addSelf, $removeSelf ) { global $wgLang; - // prevent double entries if misconfigured, bug 19301 - $add = array_unique( $add ); - $remove = array_unique( $remove ); - $addSelf = array_unique( $addSelf ); - $removeSelf = array_unique( $removeSelf ); - $r = array(); foreach( $permissions as $permission => $granted ) { //show as granted only if it isn't revoked to prevent duplicate display of permissions @@ -156,21 +150,25 @@ class SpecialListGroupRights extends SpecialPage { if( $add === true ){ $r[] = wfMsgExt( 'listgrouprights-addgroup-all', array( 'escape' ) ); } else if( is_array( $add ) && count( $add ) ) { + $add = array_unique( $add ); $r[] = wfMsgExt( 'listgrouprights-addgroup', array( 'parseinline' ), $wgLang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $add ) ), count( $add ) ); } if( $remove === true ){ $r[] = wfMsgExt( 'listgrouprights-removegroup-all', array( 'escape' ) ); } else if( is_array( $remove ) && count( $remove ) ) { + $remove = array_unique( $remove ); $r[] = wfMsgExt( 'listgrouprights-removegroup', array( 'parseinline' ), $wgLang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $remove ) ), count( $remove ) ); } if( $addSelf === true ){ $r[] = wfMsgExt( 'listgrouprights-addgroup-self-all', array( 'escape' ) ); } else if( is_array( $addSelf ) && count( $addSelf ) ) { + $addSelf = array_unique( $addSelf ); $r[] = wfMsgExt( 'listgrouprights-addgroup-self', array( 'parseinline' ), $wgLang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $addSelf ) ), count( $addSelf ) ); } if( $removeSelf === true ){ $r[] = wfMsgExt( 'listgrouprights-removegroup-self-all', array( 'escape' ) ); } else if( is_array( $removeSelf ) && count( $removeSelf ) ) { + $removeSelf = array_unique( $removeSelf ); $r[] = wfMsgExt( 'listgrouprights-removegroup-self', array( 'parseinline' ), $wgLang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $removeSelf ) ), count( $removeSelf ) ); } if( empty( $r ) ) {