r102629 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102628‎ | r102629 | r102630 >
Date:09:36, 10 November 2011
Author:freakolowsky
Status:ok
Tags:
Comment:
* reverted changes to Block and ApiBlockTest made in r102625 ... PEBKAC
Modified paths:
  • /trunk/phase3/includes/Block.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/api/ApiBlockTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/api/ApiBlockTest.php
@@ -55,7 +55,7 @@
5656
5757 $this->assertEquals( 'UTApiBlockee', (string)$block->getTarget() );
5858 $this->assertEquals( 'Some reason', $block->mReason );
59 - $this->assertEquals( $this->db->getInfinity(), $block->mExpiry );
 59+ $this->assertEquals( 'infinity', $block->mExpiry );
6060
6161 }
6262
Index: trunk/phase3/includes/Block.php
@@ -81,8 +81,8 @@
8282 $this->mAuto = $auto;
8383 $this->isHardblock( !$anonOnly );
8484 $this->prevents( 'createaccount', $createAccount );
85 - if ( $expiry == wfGetDB( DB_SLAVE )->getInfinity() ) {
86 - $this->mExpiry = $expiry;
 85+ if ( $expiry == 'infinity' || $expiry == wfGetDB( DB_SLAVE )->getInfinity() ) {
 86+ $this->mExpiry = 'infinity';
8787 } else {
8888 $this->mExpiry = wfTimestamp( TS_MW, $expiry );
8989 }
@@ -362,8 +362,9 @@
363363 $this->mId = $row->ipb_id;
364364
365365 // I wish I didn't have to do this
366 - if ( $row->ipb_expiry == wfGetDB( DB_SLAVE )->getInfinity() ) {
367 - $this->mExpiry = $row->ipb_expiry;
 366+ $db = wfGetDB( DB_SLAVE );
 367+ if ( $row->ipb_expiry == $db->getInfinity() ) {
 368+ $this->mExpiry = 'infinity';
368369 } else {
369370 $this->mExpiry = wfTimestamp( TS_MW, $row->ipb_expiry );
370371 }
@@ -652,7 +653,7 @@
653654 $autoblock->mHideName = $this->mHideName;
654655 $autoblock->prevents( 'editownusertalk', $this->prevents( 'editownusertalk' ) );
655656
656 - if ( $this->mExpiry == wfGetDB( DB_SLAVE )->getInfinity() ) {
 657+ if ( $this->mExpiry == 'infinity' ) {
657658 # Original block was indefinite, start an autoblock now
658659 $autoblock->mExpiry = Block::getAutoblockExpiry( $timestamp );
659660 } else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102625* Added getInfinity to DatabaseOracle...freakolowsky07:41, 10 November 2011

Status & tagging log