From 175dc6dad23f2dc37b8d332711f00475f9985700 Mon Sep 17 00:00:00 2001 From: Daniel Cannon Date: Tue, 13 Nov 2007 05:09:30 +0000 Subject: [PATCH] If an IP address is blocked as part of a rangeblock, attempting to unblock the single IP should not unblock the entire range. --- RELEASE-NOTES | 2 ++ includes/SpecialIpblocklist.php | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c82e5718ac..e4bfac6ab4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -147,6 +147,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN article text, rather than getting 150 characters (which may be too much) * Add two messages for Special:Blockme which were used but undefined * (bug 11921) Support plural in message number_of_watching_users_pageview +* If an IP address is blocked as part of a rangeblock, attempting to unblock + the single IP should not unblock the entire range. === API changes in 1.12 === diff --git a/includes/SpecialIpblocklist.php b/includes/SpecialIpblocklist.php index 015da0d195..6edbd7abe4 100644 --- a/includes/SpecialIpblocklist.php +++ b/includes/SpecialIpblocklist.php @@ -156,8 +156,14 @@ class IPUnblockForm { $block = Block::newFromID( $id ); } else { $block = Block::newFromDB( $this->ip ); + if ( !$block ) { $block = null; + } else if ( !$block->mUser && $block->mRangeStart + && !strstr ( $this->ip, "/" ) ) { + /* If the specified IP is a single address, and the block is + * a range block, don't unblock the range. */ + $block = null; } } } -- 2.20.1