From c397762920564be1c7fe459b08be5ecacabb758e Mon Sep 17 00:00:00 2001 From: Thalia Date: Mon, 25 Mar 2019 15:11:26 +0000 Subject: [PATCH] Use Block::setTimestamp to set the timestamp on a block Follow-up to I767ed44ce4c2e, where the setter was added. Change-Id: I888e758aef44a101068bd52e89636e2656899f62 --- includes/Block.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/Block.php b/includes/Block.php index 7e32f7ec0d..04a5a15090 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -166,7 +166,7 @@ class Block { } $this->setReason( $options['reason'] ); - $this->mTimestamp = wfTimestamp( TS_MW, $options['timestamp'] ); + $this->setTimestamp( wfTimestamp( TS_MW, $options['timestamp'] ) ); $this->setExpiry( wfGetDB( DB_REPLICA )->decodeExpiry( $options['expiry'] ) ); # Boolean settings @@ -471,7 +471,7 @@ class Block { $row->ipb_by, $row->ipb_by_text, $row->ipb_by_actor ?? null ) ); - $this->mTimestamp = wfTimestamp( TS_MW, $row->ipb_timestamp ); + $this->setTimestamp( wfTimestamp( TS_MW, $row->ipb_timestamp ) ); $this->mAuto = $row->ipb_auto; $this->setHideName( $row->ipb_deleted ); $this->mId = (int)$row->ipb_id; @@ -904,7 +904,7 @@ class Block { ->inContentLanguage()->plain() ); $timestamp = wfTimestampNow(); - $autoblock->mTimestamp = $timestamp; + $autoblock->setTimestamp( $timestamp ); $autoblock->mAuto = 1; $autoblock->isCreateAccountBlocked( $this->isCreateAccountBlocked() ); # Continue suppressing the name if needed @@ -975,7 +975,7 @@ class Block { */ public function updateTimestamp() { if ( $this->mAuto ) { - $this->mTimestamp = wfTimestamp(); + $this->setTimestamp( wfTimestamp() ); $this->setExpiry( self::getAutoblockExpiry( $this->getTimestamp() ) ); $dbw = wfGetDB( DB_MASTER ); -- 2.20.1