Page MenuHomePhabricator

Show correct value for 'hidename' in ApiBlock results
Closed, ResolvedPublic

Description

If blocking an IP address via ApiBlock, with the "hidename" parameter set to true, the block is successful, but the block doesn't actually hide the IP address (IP addresses can't be hidden).

However, in the API response, it appears as though the block will hide the IP address:

"block": {
    "user": "4.3.2.1",
    "userID": 0,
    "expiry": "infinite",
    "id": 1605,
    "reason": "",
    "anononly": false,
    "nocreate": false,
    "autoblock": false,
    "noemail": false,
    "hidename": true,
    "allowusertalk": false,
    "watchuser": false,
    "partial": false,
    "pagerestrictions": null,
    "namespacerestrictions": null,
    "actionrestrictions": null
}

Note: "hidename": true,.

The API response should report "hidename": false, if the block does not hide the target.

Event Timeline

Change 946603 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/core@master] ApiBlock: Report the correct value for 'hidename' in response

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

Change 946603 merged by jenkins-bot:

[mediawiki/core@master] ApiBlock: Report the correct value for 'hidename' in response

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

dom_walden subscribed.

We always report "hidename": false when blocking IPs, regardless of the value of the hidename parameter.

We continue to report the correct values for named accounts and temporary accounts.

Test environment: https://de.wikipedia.beta.wmflabs.org MediaWiki 1.41.0-alpha (65dacd5) 10:19, 15 August 2023.