While writing a script that interfaces with the checkuser log API, I discovered that it does not handle IP ranges in the same way as Special:CheckUserLog. Searching for an IP or range in Special:CheckUserLog will return checks overlapping the search target (so if I search for 192.168.1.0/24, it will return checks made on 192.168.1.1 and on 192.168.0.0/16). The API, on the other hand, only returns exact matches to the IP or range that was searched.
List of steps to reproduce (step by step, including full links if applicable):
- Use the checkuser tool on an IP address (I performed test checks on 192.0.2.1 and 192.0.2.0/24, both in a reserved test range, at https://en.wikipedia.org/w/index.php?title=Special:CheckUserLog&offset=202112020008 and https://en.wikipedia.org/w/index.php?title=Special:CheckUserLog&offset=202112020009)
- Search Special:CheckUserLog for a range containing that IP (https://en.wikipedia.org/wiki/Special:CheckUserLog?cuSearch=192.0.2.0%2F24&cuSearchType=target&year=&month=-1)
- Query the checkuserlog API for a range containing that IP (https://en.wikipedia.org/w/api.php?action=query&format=json&list=checkuserlog&cultarget=192.0.2.0%2F24)
What happens?:
The two searches should return the same list of checks.
What should have happened instead?:
The two results differ - Special:CheckUser lists both checks I made (as well as a few past checks that were overly-broad), while the API lists only the range check that I made.
Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc: I think the API is performing an exact string match rather than handling the IP as an IP - if I search both the Special: page and the API for 192.0.2.1/24 (https://en.wikipedia.org/w/api.php?action=query&format=json&list=checkuserlog&cultarget=192.0.2.1%2F24), Special:CheckUserLog returns the same results (expected) but the API now returns no results (not expected).