From 65957ef12cde9fae3a1fd0c38f2a848456247e34 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Fri, 3 Nov 2006 13:24:53 +0000 Subject: [PATCH] Various fixes related to the blocking change re: autoblocks. On inserting an IP block, the ipb_enable_autoblock field is now automagically blanked, because it doesn't make any sense for an IP block. Additionally, IP blocks without the ipb_enable_autoblock option no longer show up as "autoblock disabled" on Special:Ipblocklist. --- RELEASE-NOTES | 5 +++++ includes/Block.php | 5 +++++ includes/SpecialIpblocklist.php | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 48ea4a8c24..6ae9087181 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -132,6 +132,11 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 7785) Postgres compatibility for timestamps in RC feeds * (bug 7550) Normalize user parameter normally on Special:Log * (bug 7294) Fix PATH search for diff3 on install +* Various fixes related to the blocking change re: autoblocks. On inserting + an IP block, the ipb_enable_autoblock field is now automagically blanked, + because it doesn't make any sense for an IP. Additionally, IP blocks + without the ipb_enable_autoblock option no longer show up as "autoblock + disabled" on Special:Ipblocklist. == Languages updated == diff --git a/includes/Block.php b/includes/Block.php index 679ff1efe0..8a0f27ca46 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -367,6 +367,11 @@ class Block $this->mAnonOnly = 0; } + # Unset ipb_enable_autoblock for IP blocks, makes no sense + if ( !$this->mUser ) { + $this->mEnableAutoblock = 0; + } + # Don't collide with expired blocks Block::purgeExpired(); diff --git a/includes/SpecialIpblocklist.php b/includes/SpecialIpblocklist.php index c249e7fe7a..85764be909 100644 --- a/includes/SpecialIpblocklist.php +++ b/includes/SpecialIpblocklist.php @@ -277,7 +277,7 @@ class IPUnblockForm { if ( $block->mCreateAccount ) { $properties[] = $msg['createaccountblock']; } - if (!$block->mEnableAutoblock ) { + if (!$block->mEnableAutoblock && !$block->mAddress ) { $properties[] = $msg['noautoblockblock']; } -- 2.20.1