From ab8784dcdb591360e78f218c479d7f84b1f5dfca Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 9 Jun 2008 22:03:29 +0000 Subject: [PATCH] Alrighty, now we properly remove old blocks before inserting the new one. (Bug 10080 works finally!) --- includes/SpecialBlockip.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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)); -- 2.20.1