r83776 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83775‎ | r83776 | r83777 >
Date:18:43, 12 March 2011
Author:happy-melon
Status:ok
Tags:
Comment:
Backport the deprecation of $wgSysopRangeBans and $wgSysopUserBans from r83755 to 1.17. The only functional change is to change the error message produced from setting $wgBlockCIDRLimit['IPv4'] = 32 from "range too big" to "rangeblock disabled".
Modified paths:
  • /branches/REL1_17/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_17/phase3/includes/DefaultSettings.php (modified) (history)
  • /branches/REL1_17/phase3/includes/specials/SpecialBlockip.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/includes/DefaultSettings.php
@@ -3103,10 +3103,16 @@
31043104 * @{
31053105 */
31063106
3107 -/** Allow sysops to ban logged-in users */
 3107+/**
 3108+ * Allow sysops to ban logged-in users
 3109+ * @deprecated since 1.17, will be made permanently true in 1.18
 3110+ */
31083111 $wgSysopUserBans = true;
31093112
3110 -/** Allow sysops to ban IP ranges */
 3113+/**
 3114+ * Allow sysops to ban IP ranges
 3115+ * @deprecated since 1.17; set $wgBlockCIDRLimit to array( 'IPv4' => 32, 'IPv6 => 128 ) instead.
 3116+ */
31113117 $wgSysopRangeBans = true;
31123118
31133119 /**
Index: branches/REL1_17/phase3/includes/specials/SpecialBlockip.php
@@ -433,7 +433,7 @@
434434 $matches = array();
435435 if( preg_match( "/^($rxIP4)\\/(\\d{1,2})$/", $this->BlockAddress, $matches ) ) {
436436 # IPv4
437 - if( $wgSysopRangeBans ) {
 437+ if( $wgSysopRangeBans && $wgBlockCIDRLimit['IPv4'] != 32 ) {
438438 if( !IP::isIPv4( $this->BlockAddress ) || $matches[2] > 32 ) {
439439 return array( 'ip_range_invalid' );
440440 } elseif ( $matches[2] < $wgBlockCIDRLimit['IPv4'] ) {
@@ -446,7 +446,7 @@
447447 }
448448 } elseif( preg_match( "/^($rxIP6)\\/(\\d{1,3})$/", $this->BlockAddress, $matches ) ) {
449449 # IPv6
450 - if( $wgSysopRangeBans ) {
 450+ if( $wgSysopRangeBans && $wgBlockCIDRLimit['IPv6'] != 128 ) {
451451 if( !IP::isIPv6( $this->BlockAddress ) || $matches[2] > 128 ) {
452452 return array( 'ip_range_invalid' );
453453 } elseif( $matches[2] < $wgBlockCIDRLimit['IPv6'] ) {
Index: branches/REL1_17/phase3/RELEASE-NOTES
@@ -109,6 +109,12 @@
110110 which should be resolved by the 1.18 release
111111 * $wgCopyrightIcon is deprecated and $wgFooterIcons['copyright']['copyright'] should
112112 be used instead.
 113+* $wgSysopUserBans is deprecated, and will be made permanently true in 1.18.
 114+ If you need this functionality, you should use the BlockIp hook to filter and
 115+ reject such blocks.
 116+* $wgSysopRangeBans is deprecated, you should set $wgBlockCIDRLimit to maximum
 117+ (32 for IPv4, 128 for IPv6), equivalent to allowing rangeblocks of only 1
 118+ address at a time.
113119
114120 === New features in 1.17 ===
115121 * (bug 10183) Users can now add personal styles and scripts to all skins via

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r83755Deprecate $wgSysopUserBans and $wgSysopRangeBans, both of which are pre-1.2, ...happy-melon12:13, 12 March 2011

Status & tagging log