diff --git a/includes/AbuseFilter.php b/includes/AbuseFilter.php index 45ad97eba..b182c5373 100644 --- a/includes/AbuseFilter.php +++ b/includes/AbuseFilter.php @@ -1577,6 +1577,9 @@ class AbuseFilter { if ( !$wgUser->isAnon() ) { // Remove all groups from the user. $groups = $wgUser->getGroups(); + // Make sure that the stored var dump contains user groups, since we may + // need them if reverting this degroup via Special:AbuseFilter/revert + $vars->setVar( 'user_groups', $groups ); foreach ( $groups as $group ) { $wgUser->removeGroup( $group ); diff --git a/includes/Views/AbuseFilterViewRevert.php b/includes/Views/AbuseFilterViewRevert.php index 446eae86a..ab48d6966 100644 --- a/includes/Views/AbuseFilterViewRevert.php +++ b/includes/Views/AbuseFilterViewRevert.php @@ -269,8 +269,7 @@ class AbuseFilterViewRevert extends AbuseFilterView { return true; case 'degroup': // Pull the user's groups from the vars. - $oldGroups = $result['vars']['USER_GROUPS']; - $oldGroups = explode( ',', $oldGroups ); + $oldGroups = $result['vars']->getVar( 'user_groups' )->toNative(); $oldGroups = array_diff( $oldGroups, array_intersect( $oldGroups, User::getImplicitGroups() )