From c0ae1737594a568e52cca0ca006e69b1b52802b3 Mon Sep 17 00:00:00 2001 From: Alex Z Date: Sat, 1 Nov 2008 21:46:47 +0000 Subject: [PATCH] Fix rangeblock detection --- includes/specials/SpecialBlockip.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index c04cf960ef..15edf74505 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -100,9 +100,12 @@ class IPBlockForm { if ( is_object( $user ) ) $userId = $user->getId(); $currentBlock = Block::newFromDB( $this->BlockAddress, $userId ); - if ( !is_null($currentBlock) && !$currentBlock->mAuto && !($currentBlock->mRangeStart && $currentBlock->mAddress != $this->BlockAddress) ) { - $wgOut->addWikiMsg( 'ipb-needreblock', $this->BlockAddress ); - $alreadyBlocked = true; + if ( !is_null($currentBlock) && !$currentBlock->mAuto && # The block exists and isn't an autoblock + ( $currentBlock->mRangeStart == $currentBlock->mRangeEnd || # The block isn't a rangeblock + # or if it is, the range is what we're about to block + ( $currentBlock->mAddress == $this->BlockAddress ) ) ) { + $wgOut->addWikiMsg( 'ipb-needreblock', $this->BlockAddress ); + $alreadyBlocked = true; } } -- 2.20.1