Index: trunk/phase3/tests/phpunit/includes/api/ApiBlockTest.php |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | |
57 | 57 | $this->assertEquals( 'UTApiBlockee', (string)$block->getTarget() ); |
58 | 58 | $this->assertEquals( 'Some reason', $block->mReason ); |
59 | | - $this->assertEquals( $this->db->getInfinity(), $block->mExpiry ); |
| 59 | + $this->assertEquals( 'infinity', $block->mExpiry ); |
60 | 60 | |
61 | 61 | } |
62 | 62 | |
Index: trunk/phase3/includes/Block.php |
— | — | @@ -81,8 +81,8 @@ |
82 | 82 | $this->mAuto = $auto; |
83 | 83 | $this->isHardblock( !$anonOnly ); |
84 | 84 | $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'; |
87 | 87 | } else { |
88 | 88 | $this->mExpiry = wfTimestamp( TS_MW, $expiry ); |
89 | 89 | } |
— | — | @@ -362,8 +362,9 @@ |
363 | 363 | $this->mId = $row->ipb_id; |
364 | 364 | |
365 | 365 | // 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'; |
368 | 369 | } else { |
369 | 370 | $this->mExpiry = wfTimestamp( TS_MW, $row->ipb_expiry ); |
370 | 371 | } |
— | — | @@ -652,7 +653,7 @@ |
653 | 654 | $autoblock->mHideName = $this->mHideName; |
654 | 655 | $autoblock->prevents( 'editownusertalk', $this->prevents( 'editownusertalk' ) ); |
655 | 656 | |
656 | | - if ( $this->mExpiry == wfGetDB( DB_SLAVE )->getInfinity() ) { |
| 657 | + if ( $this->mExpiry == 'infinity' ) { |
657 | 658 | # Original block was indefinite, start an autoblock now |
658 | 659 | $autoblock->mExpiry = Block::getAutoblockExpiry( $timestamp ); |
659 | 660 | } else { |