Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1302,7 +1302,10 @@ |
1303 | 1303 | $wgAutoblockExpiry = 86400; # Number of seconds before autoblock entries expire |
1304 | 1304 | $wgBlockAllowsUTEdit = false; # Default setting for option on block form to allow self talkpage editing whilst blocked |
1305 | 1305 | $wgSysopEmailBans = true; # Allow sysops to ban users from accessing Emailuser |
1306 | | -$wgBlockCIDRLimit = 16; # Blocks larger than a /16 (64k addresses) will not be allowed |
| 1306 | +$wgBlockCIDRLimit = array( |
| 1307 | + 'IPv4' => 16, # Blocks larger than a /16 (64k addresses) will not be allowed |
| 1308 | + 'IPv6' => 64, # 2^64 = ~1.8x10^19 addresses |
| 1309 | +); |
1307 | 1310 | |
1308 | 1311 | # Pages anonymous user may see as an array, e.g.: |
1309 | 1312 | # array ( "Main Page", "Wikipedia:Help"); |
Index: trunk/phase3/includes/specials/SpecialBlockip.php |
— | — | @@ -383,8 +383,10 @@ |
384 | 384 | if( preg_match( "/^($rxIP4)\\/(\\d{1,2})$/", $this->BlockAddress, $matches ) ) { |
385 | 385 | # IPv4 |
386 | 386 | if( $wgSysopRangeBans ) { |
387 | | - if( !IP::isIPv4( $this->BlockAddress ) || $matches[2] < $wgBlockCIDRLimit || $matches[2] > 32 ) { |
| 387 | + if( !IP::isIPv4( $this->BlockAddress ) || $matches[2] > 32 ) { |
388 | 388 | return array( 'ip_range_invalid' ); |
| 389 | + } elseif ( $matches[2] < $wgBlockCIDRLimit['IPv4'] ) { |
| 390 | + return array( 'ip_range_toolarge', $wgBlockCIDRLimit['IPv4'] ); |
389 | 391 | } |
390 | 392 | $this->BlockAddress = Block::normaliseRange( $this->BlockAddress ); |
391 | 393 | } else { |
— | — | @@ -394,8 +396,10 @@ |
395 | 397 | } elseif( preg_match( "/^($rxIP6)\\/(\\d{1,3})$/", $this->BlockAddress, $matches ) ) { |
396 | 398 | # IPv6 |
397 | 399 | if( $wgSysopRangeBans ) { |
398 | | - if( !IP::isIPv6( $this->BlockAddress ) || $matches[2] < 64 || $matches[2] > 128 ) { |
| 400 | + if( !IP::isIPv6( $this->BlockAddress ) || $matches[2] > 128 ) { |
399 | 401 | return array( 'ip_range_invalid' ); |
| 402 | + } elseif( $matches[2] < $wgBlockCIDRLimit['IPv6'] ) { |
| 403 | + return array( 'ip_range_toolarge', $wgBlockCIDRLimit['IPv6'] ); |
400 | 404 | } |
401 | 405 | $this->BlockAddress = Block::normaliseRange( $this->BlockAddress ); |
402 | 406 | } else { |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2958,6 +2958,7 @@ |
2959 | 2959 | 'ipb_blocked_as_range' => 'Error: The IP address $1 is not blocked directly and cannot be unblocked. |
2960 | 2960 | It is, however, blocked as part of the range $2, which can be unblocked.', |
2961 | 2961 | 'ip_range_invalid' => 'Invalid IP range.', |
| 2962 | +'ip_range_toolarge' => 'Range blocks larger than /$1 are not allowed.', |
2962 | 2963 | 'blockme' => 'Block me', |
2963 | 2964 | 'proxyblocker' => 'Proxy blocker', |
2964 | 2965 | 'proxyblocker-disabled' => 'This function is disabled.', |