In $wgAddGroups, $wgRemoveGroups, $wgGroupsAddToSelf, and
$wgGroupsRemoveFromSelf, boolean true in place of an array of groups to
allow adding/removing is shorthand for "all groups". Handle this
appropriately in action=query&meta=siteinfo&siprop=usergroups.
Bug: T135467
Change-Id: I6ae61ef14ac7932e3369155c56bad60a9d72060d
$data = [];
$result = $this->getResult();
- $allGroups = User::getAllGroups();
+ $allGroups = array_values( User::getAllGroups() );
foreach ( $config->get( 'GroupPermissions' ) as $group => $permissions ) {
$arr = [
'name' => $group,
foreach ( $groupArr as $type => $rights ) {
if ( isset( $rights[$group] ) ) {
- $groups = array_intersect( $rights[$group], $allGroups );
+ if ( $rights[$group] === true ) {
+ $groups = $allGroups;
+ } else {
+ $groups = array_intersect( $rights[$group], $allGroups );
+ }
if ( $groups ) {
$arr[$type] = $groups;
ApiResult::setArrayType( $arr[$type], 'BCarray' );