r36109 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36108‎ | r36109 | r36110 >
Date:22:03, 9 June 2008
Author:demon
Status:old
Tags:
Comment:
Alrighty, now we properly remove old blocks before inserting the new one. (Bug 10080 works finally!)
Modified paths:
  • /trunk/phase3/includes/SpecialBlockip.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialBlockip.php
@@ -388,13 +388,12 @@
389389
390390 if ( wfRunHooks('BlockIp', array(&$block, &$wgUser)) ) {
391391
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
397394 }
 395+ $block->insert();
398396
 397+
399398 wfRunHooks('BlockIpComplete', array($block, $wgUser));
400399
401400 if ( $this->BlockWatchUser ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r36113Revert r36076, r36109, r36110 -- just doesn't work right. Sometimes removes b...brion23:16, 9 June 2008
r42843(bug 10080) (bug 15820) - Allow modification of blocks without unblocking, an...mrzman21:45, 30 October 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r35901Bug 10080 - Sysops can now modify a block without unblocking first. Patch by ...demon00:11, 5 June 2008
r36076Bug 10080 - Finally fixed. No longer mis-detects an individual IP as blocked ...demon13:03, 9 June 2008

Status & tagging log