$this->mAuto = $auto;
$this->isHardblock( !$anonOnly );
$this->prevents( 'createaccount', $createAccount );
- if ( $expiry == 'infinity' || $expiry == wfGetDB( DB_SLAVE )->getInfinity() ) {
- $this->mExpiry = 'infinity';
+ if ( $expiry == wfGetDB( DB_SLAVE )->getInfinity() ) {
+ $this->mExpiry = $expiry;
} else {
$this->mExpiry = wfTimestamp( TS_MW, $expiry );
}
$this->mId = $row->ipb_id;
// I wish I didn't have to do this
- $db = wfGetDB( DB_SLAVE );
- if ( $row->ipb_expiry == $db->getInfinity() ) {
- $this->mExpiry = 'infinity';
+ if ( $row->ipb_expiry == wfGetDB( DB_SLAVE )->getInfinity() ) {
+ $this->mExpiry = $row->ipb_expiry;
} else {
$this->mExpiry = wfTimestamp( TS_MW, $row->ipb_expiry );
}
$autoblock->mHideName = $this->mHideName;
$autoblock->prevents( 'editownusertalk', $this->prevents( 'editownusertalk' ) );
- if ( $this->mExpiry == 'infinity' ) {
+ if ( $this->mExpiry == wfGetDB( DB_SLAVE )->getInfinity() ) {
# Original block was indefinite, start an autoblock now
$autoblock->mExpiry = Block::getAutoblockExpiry( $timestamp );
} else {
$this->addWhereIf( 'ipb_user != 0', isset( $show['account'] ) );
$this->addWhereIf( 'ipb_user != 0 OR ipb_range_end > ipb_range_start', isset( $show['!ip'] ) );
$this->addWhereIf( 'ipb_user = 0 AND ipb_range_end = ipb_range_start', isset( $show['ip'] ) );
- $this->addWhereIf( "ipb_expiry = 'infinity'", isset( $show['!temp'] ) );
- $this->addWhereIf( "ipb_expiry != 'infinity'", isset( $show['temp'] ) );
+ $this->addWhereIf( "ipb_expiry = '".$db->getInfinity()."'", isset( $show['!temp'] ) );
+ $this->addWhereIf( "ipb_expiry != '".$db->getInfinity()."'", isset( $show['temp'] ) );
$this->addWhereIf( "ipb_range_end = ipb_range_start", isset( $show['!range'] ) );
$this->addWhereIf( "ipb_range_end > ipb_range_start", isset( $show['range'] ) );
}
$val = $val->fetch();
}
+ // backward compatibility
if ( preg_match( '/^timestamp.*/i', $col_type ) == 1 && strtolower( $val ) == 'infinity' ) {
- $val = '31-12-2030 12:00:00.000000';
+ $val = $this->getInfinity();
}
$val = ( $wgContLang != null ) ? $wgContLang->checkTitleEncoding( $val ) : $val;
public function getSearchEngine() {
return 'SearchOracle';
}
+
+ public function getInfinity() {
+ return '31-12-2030 12:00:00.000000';
+ }
+
} // end DatabaseOracle class
$dbw = $this->repo->getMasterDb();
$this->fileMetadata[$key] = array(
+ 'us_id' => $dbw->nextSequenceValue( 'uploadstash_us_id_seq' ),
'us_user' => $this->userId,
'us_key' => $key,
'us_orig_path' => $path,
$this->assertEquals( 'UTApiBlockee', (string)$block->getTarget() );
$this->assertEquals( 'Some reason', $block->mReason );
- $this->assertEquals( 'infinity', $block->mExpiry );
+ $this->assertEquals( $this->db->getInfinity(), $block->mExpiry );
}