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( 'infinity', $block->mExpiry ); |
| 59 | + $this->assertEquals( $this->db->getInfinity(), $block->mExpiry ); |
60 | 60 | |
61 | 61 | } |
62 | 62 | |
Index: trunk/phase3/includes/upload/UploadStash.php |
— | — | @@ -229,6 +229,7 @@ |
230 | 230 | $dbw = $this->repo->getMasterDb(); |
231 | 231 | |
232 | 232 | $this->fileMetadata[$key] = array( |
| 233 | + 'us_id' => $dbw->nextSequenceValue( 'uploadstash_us_id_seq' ), |
233 | 234 | 'us_user' => $this->userId, |
234 | 235 | 'us_key' => $key, |
235 | 236 | 'us_orig_path' => $path, |
Index: trunk/phase3/includes/db/DatabaseOracle.php |
— | — | @@ -548,8 +548,9 @@ |
549 | 549 | $val = $val->fetch(); |
550 | 550 | } |
551 | 551 | |
| 552 | + // backward compatibility |
552 | 553 | if ( preg_match( '/^timestamp.*/i', $col_type ) == 1 && strtolower( $val ) == 'infinity' ) { |
553 | | - $val = '31-12-2030 12:00:00.000000'; |
| 554 | + $val = $this->getInfinity(); |
554 | 555 | } |
555 | 556 | |
556 | 557 | $val = ( $wgContLang != null ) ? $wgContLang->checkTitleEncoding( $val ) : $val; |
— | — | @@ -1315,4 +1316,9 @@ |
1316 | 1317 | public function getSearchEngine() { |
1317 | 1318 | return 'SearchOracle'; |
1318 | 1319 | } |
| 1320 | + |
| 1321 | + public function getInfinity() { |
| 1322 | + return '31-12-2030 12:00:00.000000'; |
| 1323 | + } |
| 1324 | + |
1319 | 1325 | } // end DatabaseOracle class |
Index: trunk/phase3/includes/api/ApiQueryBlocks.php |
— | — | @@ -130,8 +130,8 @@ |
131 | 131 | $this->addWhereIf( 'ipb_user != 0', isset( $show['account'] ) ); |
132 | 132 | $this->addWhereIf( 'ipb_user != 0 OR ipb_range_end > ipb_range_start', isset( $show['!ip'] ) ); |
133 | 133 | $this->addWhereIf( 'ipb_user = 0 AND ipb_range_end = ipb_range_start', isset( $show['ip'] ) ); |
134 | | - $this->addWhereIf( "ipb_expiry = 'infinity'", isset( $show['!temp'] ) ); |
135 | | - $this->addWhereIf( "ipb_expiry != 'infinity'", isset( $show['temp'] ) ); |
| 134 | + $this->addWhereIf( "ipb_expiry = '".$db->getInfinity()."'", isset( $show['!temp'] ) ); |
| 135 | + $this->addWhereIf( "ipb_expiry != '".$db->getInfinity()."'", isset( $show['temp'] ) ); |
136 | 136 | $this->addWhereIf( "ipb_range_end = ipb_range_start", isset( $show['!range'] ) ); |
137 | 137 | $this->addWhereIf( "ipb_range_end > ipb_range_start", isset( $show['range'] ) ); |
138 | 138 | } |
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 == 'infinity' || $expiry == wfGetDB( DB_SLAVE )->getInfinity() ) { |
86 | | - $this->mExpiry = 'infinity'; |
| 85 | + if ( $expiry == wfGetDB( DB_SLAVE )->getInfinity() ) { |
| 86 | + $this->mExpiry = $expiry; |
87 | 87 | } else { |
88 | 88 | $this->mExpiry = wfTimestamp( TS_MW, $expiry ); |
89 | 89 | } |
— | — | @@ -362,9 +362,8 @@ |
363 | 363 | $this->mId = $row->ipb_id; |
364 | 364 | |
365 | 365 | // I wish I didn't have to do this |
366 | | - $db = wfGetDB( DB_SLAVE ); |
367 | | - if ( $row->ipb_expiry == $db->getInfinity() ) { |
368 | | - $this->mExpiry = 'infinity'; |
| 366 | + if ( $row->ipb_expiry == wfGetDB( DB_SLAVE )->getInfinity() ) { |
| 367 | + $this->mExpiry = $row->ipb_expiry; |
369 | 368 | } else { |
370 | 369 | $this->mExpiry = wfTimestamp( TS_MW, $row->ipb_expiry ); |
371 | 370 | } |
— | — | @@ -653,7 +652,7 @@ |
654 | 653 | $autoblock->mHideName = $this->mHideName; |
655 | 654 | $autoblock->prevents( 'editownusertalk', $this->prevents( 'editownusertalk' ) ); |
656 | 655 | |
657 | | - if ( $this->mExpiry == 'infinity' ) { |
| 656 | + if ( $this->mExpiry == wfGetDB( DB_SLAVE )->getInfinity() ) { |
658 | 657 | # Original block was indefinite, start an autoblock now |
659 | 658 | $autoblock->mExpiry = Block::getAutoblockExpiry( $timestamp ); |
660 | 659 | } else { |