summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
27fbb0c)
Found by the new ApiUserrights test introduced in
5ab1bee6bcf:
> includes/specials/SpecialUserrights.php:462
> includes/specials/SpecialUserrights.php:405
> includes/api/ApiUserrights.php:116
The $tags parameter of the UserrightsPage::doSaveUserGroups()
method must be an array and is not nullable. Fix the caller
to not pass null, but an empty array.
Bug: T182377
Change-Id: Ic9be6a0bddfac023de765c810c07a64d651c33b4
$tags = $params['tags'];
// Check if user can add tags
$tags = $params['tags'];
// Check if user can add tags
- if ( !is_null( $tags ) ) {
+ if ( $tags !== null ) {
$ableToTag = ChangeTags::canAddTagsAccompanyingChange( $tags, $pUser );
if ( !$ableToTag->isOK() ) {
$this->dieStatus( $ableToTag );
$ableToTag = ChangeTags::canAddTagsAccompanyingChange( $tags, $pUser );
if ( !$ableToTag->isOK() ) {
$this->dieStatus( $ableToTag );
$r['user'] = $user->getName();
$r['userid'] = $user->getId();
list( $r['added'], $r['removed'] ) = $form->doSaveUserGroups(
$r['user'] = $user->getName();
$r['userid'] = $user->getId();
list( $r['added'], $r['removed'] ) = $form->doSaveUserGroups(
+ // Don't pass null to doSaveUserGroups() for array params, cast to empty array
$user, (array)$add, (array)$params['remove'],
$user, (array)$add, (array)$params['remove'],
- $params['reason'], $tags, $groupExpiries
+ $params['reason'], (array)$tags, $groupExpiries
);
$result = $this->getResult();
);
$result = $this->getResult();