From: Alex Z Date: Sat, 1 Nov 2008 21:46:47 +0000 (+0000) Subject: Fix rangeblock detection X-Git-Tag: 1.31.0-rc.0~44477 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=c0ae1737594a568e52cca0ca006e69b1b52802b3;p=lhc%2Fweb%2Fwiklou.git Fix rangeblock detection --- 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; } }