Last modified: 2013-10-27 23:33:21 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 55997 - Need documentation for ip_in_range()
Need documentation for ip_in_range()
Product: MediaWiki extensions
Classification: Unclassified
AbuseFilter (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: documentation
  Show dependency treegraph
Reported: 2013-10-22 15:39 UTC by Al Johnson
Modified: 2013-10-27 23:33 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Al Johnson 2013-10-22 15:39:14 UTC
There is no documentation on this function and guessing has got me nowhere.

I tried this:

ip_in_range(user_name, "")

but no go.  Is a user_ip variable no available?  Does the user_name hold ip addresses for anonymous users?  I need to check the IPs of registered users.
Comment 1 Andre Klapper 2013-10-22 16:31:50 UTC
Same question brought up here:

Wondering if docs could be linked to
Comment 2 Umherirrender 2013-10-22 17:39:26 UTC
Call is "ip_in_range(ip, range)" and that is delegated to MediaWiki's IP::isInRange

A help text for the scroll down box on [[Special:AbuseFilter/test]] exists ("Is IP in range? (ip_in_range)")
Comment 3 Al Johnson 2013-10-22 20:04:51 UTC
Andre, the main question is what variable to use for the first parameter for the user's IP address.
Comment 4 Kunal Mehta (Legoktm) 2013-10-26 04:53:25 UTC
The AbuseFilter does not allow you to use the IP address of a registered user. The ip_in_range function is supposed to be used for anonymous users, when you want a filter to target a specific range rather than everyone.
Comment 5 Al Johnson 2013-10-27 17:19:48 UTC
Kunal, why not?  Is there some wiki philosophy or guiding principle that I am not aware of?  Confused.
Comment 6 Umherirrender 2013-10-27 20:53:05 UTC
With the abusefilter-private user right, you can see the ip of the user, which trigged the filter. On WMF wikis this is not available, due to private policy. Only CheckUsers are allowed to see the ip of a user.

It looks like there is no way to filter against this field, because than the filter and the log details must be hidden to avoid other users to see the ip or with help of the filter regex to determine a possible ip.
Comment 7 Al Johnson 2013-10-27 23:33:21 UTC
My solution was to create a new filter variable, user_ip.  So, the IP doesn't need to be shown in the log.  It's not even worth me pasting the code it's so easy.

Note You need to log in before you can comment on or make changes to this bug.