Support CIDR ranges in $wgSquidServersNoPurge
authorBryan Davis <bd808@wikimedia.org>
Thu, 7 Nov 2013 19:59:13 +0000 (12:59 -0700)
committerBryan Davis <bd808@wikimedia.org>
Thu, 7 Nov 2013 20:14:23 +0000 (13:14 -0700)
commitf111b2687c894bd744f53edff4ae049ddb48c59a
tree2d65294f7a5d7dceb0b94718f81670930c1f52c3
parentec998fc256be15e0ad9cff78d9b9d7330c287010
Support CIDR ranges in $wgSquidServersNoPurge

Use IP::isInRange() in wfIsConfiguredProxy() to allow matching against
CIDR entries in $wgSquidServersNoPurge. This will allow maintainers of
large networks to whitelist contiguous blocks of IPv4 and/or IPv6
addresses as trusted X-Forwarded-For providers.

This change also makes a small change to
WebRequestTest::testGetIpLackOfRemoteAddrThrowAnException() which was
failing under some configurations due to non-default globals
configuration.

Bug: 52829
Change-Id: I49e34bdf13e8e8c6cd169c362c283fe1034bdc6d
RELEASE-NOTES-1.23
includes/DefaultSettings.php
includes/ProxyTools.php
tests/phpunit/includes/WebRequestTest.php