From: Chad Horohoe Date: Mon, 9 Jun 2008 22:03:29 +0000 (+0000) Subject: Alrighty, now we properly remove old blocks before inserting the new one. (Bug 10080... X-Git-Tag: 1.31.0-rc.0~47090 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=ab8784dcdb591360e78f218c479d7f84b1f5dfca;p=lhc%2Fweb%2Fwiklou.git Alrighty, now we properly remove old blocks before inserting the new one. (Bug 10080 works finally!) --- diff --git a/includes/SpecialBlockip.php b/includes/SpecialBlockip.php index ec1fdd7886..620fd80979 100644 --- a/includes/SpecialBlockip.php +++ b/includes/SpecialBlockip.php @@ -388,12 +388,11 @@ class IPBlockForm { if ( wfRunHooks('BlockIp', array(&$block, &$wgUser)) ) { - if ( !$block->insert() ) { - // Block already exists. Silently delete the existing block and insert it again - $oldblock = Block::newFromDB( $this->BlockAddress ); - $oldblock->delete(); - $block->insert(); + if ( $oldblock = Block::newFromDB( $this->BlockAddress ) ) { + $oldblock->delete(); // Block already exists. Silently delete it } + $block->insert(); + wfRunHooks('BlockIpComplete', array($block, $wgUser));