$targetUser->clearInstanceCache(); // T40989
}
- if ( $request->getVal( 'conflictcheck-originalgroups' )
- !== implode( ',', $targetUser->getGroups() )
- ) {
+ $conflictCheck = $request->getVal( 'conflictcheck-originalgroups' );
+ $conflictCheck = ( $conflictCheck === '' ) ? [] : explode( ',', $conflictCheck );
+ $userGroups = $targetUser->getGroups();
+
+ if ( $userGroups !== $conflictCheck ) {
$out->addWikiMsg( 'userrights-conflict' );
} else {
$status = $this->saveUserGroups(