Index: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php (revision 58376)
+++ trunk/phase3/includes/DefaultSettings.php (revision 58377)
@@ -1271,6 +1271,7 @@
$wgAutoblockExpiry = 86400; # Number of seconds before autoblock entries expire
$wgBlockAllowsUTEdit = false; # Default setting for option on block form to allow self talkpage editing whilst blocked
$wgSysopEmailBans = true; # Allow sysops to ban users from accessing Emailuser
+$wgBlockCIDRLimit = 16; # Blocks below the /16 set of IPs will not be allowed
# Pages anonymous user may see as an array, e.g.:
# array ( "Main Page", "Wikipedia:Help");
Index: trunk/phase3/includes/specials/SpecialBlockip.php
===================================================================
--- trunk/phase3/includes/specials/SpecialBlockip.php (revision 58376)
+++ trunk/phase3/includes/specials/SpecialBlockip.php (revision 58377)
@@ -345,7 +345,7 @@
* @return array(message key, arguments) on failure, empty array on success
*/
function doBlock( &$userId = null, &$expiry = null ) {
- global $wgUser, $wgSysopUserBans, $wgSysopRangeBans, $wgBlockAllowsUTEdit;
+ global $wgUser, $wgSysopUserBans, $wgSysopRangeBans, $wgBlockAllowsUTEdit, $wgBlockCIDRLimit;
$userId = 0;
# Expand valid IPv6 addresses, usernames are left as is
@@ -361,7 +361,7 @@
if( preg_match( "/^($rxIP4)\\/(\\d{1,2})$/", $this->BlockAddress, $matches ) ) {
# IPv4
if( $wgSysopRangeBans ) {
- if( !IP::isIPv4( $this->BlockAddress ) || $matches[2] < 16 || $matches[2] > 32 ) {
+ if( !IP::isIPv4( $this->BlockAddress ) || $matches[2] < $wgBlockCIDRLimit || $matches[2] > 32 ) {
return array( 'ip_range_invalid' );
}
$this->BlockAddress = Block::normaliseRange( $this->BlockAddress );
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES (revision 58376)
+++ trunk/phase3/RELEASE-NOTES (revision 58377)
@@ -90,6 +90,8 @@
* $wgCapitalLinkOverrides added to configure per-namespace capitalization
* (bug 21172) $wgSorbsUrl can now be an array with multiple DNSBL
* $wgEnableHtmlDiff has been removed
+* (bug 3340) $wgBlockCIDRLimit added (default: 16) to configure the low end of
+ CIDR ranges for blocking
=== New features in 1.16 ===