Index: trunk/phase3/includes/specials/SpecialBlockip.php |
— | — | @@ -87,6 +87,7 @@ |
88 | 88 | $mIpbreason = Xml::label( wfMsg( 'ipbotherreason' ), 'mw-bi-reason' ); |
89 | 89 | |
90 | 90 | $titleObj = SpecialPage::getTitleFor( 'Blockip' ); |
| 91 | + $user = User::newFromName( $this->BlockAddress ); |
91 | 92 | |
92 | 93 | $alreadyBlocked = false; |
93 | 94 | if ( $err && $err[0] != 'ipb_already_blocked' ) { |
— | — | @@ -95,7 +96,10 @@ |
96 | 97 | $wgOut->setSubtitle( wfMsgHtml( 'formerror' ) ); |
97 | 98 | $wgOut->addHTML( Xml::tags( 'p', array( 'class' => 'error' ), $msg ) ); |
98 | 99 | } elseif ( $this->BlockAddress ) { |
99 | | - $currentBlock = Block::newFromDB( $this->BlockAddress ); |
| 100 | + $userId = 0; |
| 101 | + if ( is_object( $user ) ) |
| 102 | + $userId = $user->getId(); |
| 103 | + $currentBlock = Block::newFromDB( $this->BlockAddress, $userId ); |
100 | 104 | if ( !is_null($currentBlock) && !$currentBlock->mAuto && !($currentBlock->mRangeStart && $currentBlock->mAddress != $this->BlockAddress) ) { |
101 | 105 | $wgOut->addWikiMsg( 'ipb-needreblock', $this->BlockAddress ); |
102 | 106 | $alreadyBlocked = true; |
— | — | @@ -293,7 +297,6 @@ |
294 | 298 | |
295 | 299 | $wgOut->addHtml( $this->getConvenienceLinks() ); |
296 | 300 | |
297 | | - $user = User::newFromName( $this->BlockAddress ); |
298 | 301 | if( is_object( $user ) ) { |
299 | 302 | $this->showLogFragment( $wgOut, $user->getUserPage() ); |
300 | 303 | } elseif( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/', $this->BlockAddress ) ) { |
— | — | @@ -405,7 +408,7 @@ |
406 | 409 | return array( 'ipb_already_blocked' ); |
407 | 410 | } else { |
408 | 411 | # This returns direct blocks before autoblocks/rangeblocks, since we should be sure the user is blocked by now it should work for our purposes |
409 | | - $currentBlock = Block::newFromDB( $this->BlockAddress ); |
| 412 | + $currentBlock = Block::newFromDB( $this->BlockAddress, $userId ); |
410 | 413 | $currentBlock->delete(); |
411 | 414 | $block->insert(); |
412 | 415 | $log_action = 'reblock'; |