Page MenuHomePhabricator

Range contributions should normalize the IP prefix
Closed, ResolvedPublicFeature

Description

Feature summary (what you would like to be able to do and where):
When blocking a range, Special:Block normalizes the range by setting the least significant parts of the prefix to their lowest possible value. For example, 198.73.209.123/24 becomes 198.73.209.0/24, 2001:0db8:0123:4567:89ab:cdef:1234:5678/64 becomes 2001:DB8:123:4567:0:0:0:0/64. Special:Contributions should do the same when showing range contributions.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

The current behavior is confusing, especially for editors who don't have a full understanding of CDIR notation. It is not always clear that two ranges are the same, because they can have different representations. This is especially apparent when dealing with smaller ranges that do not affect an entire octet, like an IPv4 /27. It gets even worse dealing with IPv6.

Benefits (why should this be implemented?):
MediaWiki should treat IP ranges consistently.

Event Timeline

Change 718577 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@master] Use normalized CIDR range for navigation links on Special:Contributions

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

Umherirrender triaged this task as Low priority.

And we might also want to do the same for Special:Log. For example, block log of User:2600:1700:2070:8500::/64 displays the range blocks as expected, but User:2600:1700:2070:8500:E9EF:1BCA:92B8:77C4/64 shows nothing. This may cause some confusing as well, since it is a common use case (at least for me) to directly append /64 to a single IP and check relative logs from the range.

And we might also want to do the same for Special:Log. For example, block log of User:2600:1700:2070:8500::/64 displays the range blocks as expected, but User:2600:1700:2070:8500:E9EF:1BCA:92B8:77C4/64 shows nothing. This may cause some confusing as well, since it is a common use case (at least for me) to directly append /64 to a single IP and check relative logs from the range.

Special:Log is handled with T270798

Change 718577 merged by jenkins-bot:

[mediawiki/core@master] Use normalized CIDR range for navigation links on Special:Contributions

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