Page MenuHomePhabricator

SpecialUserrights: fetchUser() called with wrong parameters
Closed, ResolvedPublic

Description

Spotted in production as of 1.29.0-wmf.4:

Warning: fetchUser() expects exactly 2 parameters, 1 given in /srv/mediawiki/php-1.29.0-wmf.4/includes/specials/SpecialUserrights.php on line 335

Event Timeline

demon created this task.Nov 29 2016, 11:16 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 29 2016, 11:16 PM

Looks like the bad callers are ApiUserrights and ApiQueryUsers. The former should probably pass true as its $write parameter, the latter looks like it should pass false.

matmarex claimed this task.Nov 30 2016, 5:56 PM
matmarex added a subscriber: matmarex.

Whoops.

For ApiQueryUsers it doesn't really matter, it looks like the code path which checks this can't be reached (as it can't pass cross-wiki user names).

Change 324511 had a related patch set uploaded (by Bartosz Dziewoński):
SpecialUserrights: Make new fetchUser() parameter optional

https://gerrit.wikimedia.org/r/324511

Change 324516 had a related patch set uploaded (by Chad):
SpecialUserrights: Make new fetchUser() parameter optional

https://gerrit.wikimedia.org/r/324516

Change 324511 merged by jenkins-bot:
SpecialUserrights: Make new fetchUser() parameter optional

https://gerrit.wikimedia.org/r/324511

Change 324516 merged by jenkins-bot:
SpecialUserrights: Make new fetchUser() parameter optional

https://gerrit.wikimedia.org/r/324516

demon closed this task as Resolved.Nov 30 2016, 8:10 PM