$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 larger than a /16 (64k addresses) will not be allowed
+$wgBlockCIDRLimit = array(
+ 'IPv4' => 16, # Blocks larger than a /16 (64k addresses) will not be allowed
+ 'IPv6' => 64, # 2^64 = ~1.8x10^19 addresses
+);
# Pages anonymous user may see as an array, e.g.:
# array ( "Main Page", "Wikipedia:Help");
if( preg_match( "/^($rxIP4)\\/(\\d{1,2})$/", $this->BlockAddress, $matches ) ) {
# IPv4
if( $wgSysopRangeBans ) {
- if( !IP::isIPv4( $this->BlockAddress ) || $matches[2] < $wgBlockCIDRLimit || $matches[2] > 32 ) {
+ if( !IP::isIPv4( $this->BlockAddress ) || $matches[2] > 32 ) {
return array( 'ip_range_invalid' );
+ } elseif ( $matches[2] < $wgBlockCIDRLimit['IPv4'] ) {
+ return array( 'ip_range_toolarge', $wgBlockCIDRLimit['IPv4'] );
}
$this->BlockAddress = Block::normaliseRange( $this->BlockAddress );
} else {
} elseif( preg_match( "/^($rxIP6)\\/(\\d{1,3})$/", $this->BlockAddress, $matches ) ) {
# IPv6
if( $wgSysopRangeBans ) {
- if( !IP::isIPv6( $this->BlockAddress ) || $matches[2] < 64 || $matches[2] > 128 ) {
+ if( !IP::isIPv6( $this->BlockAddress ) || $matches[2] > 128 ) {
return array( 'ip_range_invalid' );
+ } elseif( $matches[2] < $wgBlockCIDRLimit['IPv6'] ) {
+ return array( 'ip_range_toolarge', $wgBlockCIDRLimit['IPv6'] );
}
$this->BlockAddress = Block::normaliseRange( $this->BlockAddress );
} else {
'ipb_blocked_as_range' => 'Error: The IP address $1 is not blocked directly and cannot be unblocked.
It is, however, blocked as part of the range $2, which can be unblocked.',
'ip_range_invalid' => 'Invalid IP range.',
+'ip_range_toolarge' => 'Range blocks larger than /$1 are not allowed.',
'blockme' => 'Block me',
'proxyblocker' => 'Proxy blocker',
'proxyblocker-disabled' => 'This function is disabled.',