$this->mReason = $reason;
$this->mTimestamp = wfTimestamp(TS_MW,$timestamp);
$this->mAuto = $auto;
- $this->mExpiry = wfTimestamp(TS_MW,$expiry);
+ if( empty( $expiry ) ) {
+ $this->mExpiry = $expiry;
+ } else {
+ $this->mExpiry = wfTimestamp( TS_MW, $expiry );
+ }
$this->mForUpdate = false;
$this->initialiseRange();
$this->mBy = $row->ipb_by;
$this->mAuto = $row->ipb_auto;
$this->mId = $row->ipb_id;
- $this->mExpiry = wfTimestamp(TS_MW,$row->ipb_expiry);
+ $this->mExpiry = $row->ipb_expiry ?
+ wfTimestamp(TS_MW,$row->ipb_expiry) :
+ $row->ipb_expiry;
$this->initialiseRange();
}
function insert()
{
+ wfDebug( "Block::insert; timestamp {$this->mTimestamp}\n" );
$dbw =& wfGetDB( DB_MASTER );
$dbw->insert( 'ipblocks',
array(
'ipb_reason' => $this->mReason,
'ipb_timestamp' => $dbw->timestamp($this->mTimestamp),
'ipb_auto' => $this->mAuto,
- 'ipb_expiry' => $dbw->timestamp($this->mExpiry),
+ 'ipb_expiry' => $this->mExpiry ?
+ $dbw->timestamp($this->mExpiry) :
+ $this->mExpiry,
), 'Block::insert'
);