From: Gergő Tisza Date: Mon, 7 Jan 2019 02:03:07 +0000 (-0800) Subject: Special:UserRights: Fix handling of empty conflict check value X-Git-Tag: 1.34.0-rc.0~3134^2 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=ffc70d0791e75bdf9d75846e503020a857b3d65c;p=lhc%2Fweb%2Fwiklou.git Special:UserRights: Fix handling of empty conflict check value Bug: T164211 Change-Id: I6b710a25e9be29497846fafe39c916d480989a96 --- diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index 0f9ded382a..94b8184d5f 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -170,10 +170,11 @@ class UserrightsPage extends SpecialPage { $targetUser->clearInstanceCache(); // T40989 } - $checkValue = explode( ',', $request->getVal( 'conflictcheck-originalgroups' ) ); + $conflictCheck = $request->getVal( 'conflictcheck-originalgroups' ); + $conflictCheck = ( $conflictCheck === '' ) ? [] : explode( ',', $conflictCheck ); $userGroups = $targetUser->getGroups(); - if ( $userGroups !== $checkValue ) { + if ( $userGroups !== $conflictCheck ) { $out->addWikiMsg( 'userrights-conflict' ); } else { $status = $this->saveUserGroups(