Index: trunk/phase3/includes/SpecialBlockip.php |
— | — | @@ -388,13 +388,12 @@ |
389 | 389 | |
390 | 390 | if ( wfRunHooks('BlockIp', array(&$block, &$wgUser)) ) { |
391 | 391 | |
392 | | - if ( !$block->insert() ) { |
393 | | - // Block already exists. Silently delete the existing block and insert it again |
394 | | - $oldblock = Block::newFromDB( $this->BlockAddress ); |
395 | | - $oldblock->delete(); |
396 | | - $block->insert(); |
| 392 | + if ( $oldblock = Block::newFromDB( $this->BlockAddress ) ) { |
| 393 | + $oldblock->delete(); // Block already exists. Silently delete it |
397 | 394 | } |
| 395 | + $block->insert(); |
398 | 396 | |
| 397 | + |
399 | 398 | wfRunHooks('BlockIpComplete', array($block, $wgUser)); |
400 | 399 | |
401 | 400 | if ( $this->BlockWatchUser ) { |