From 377c76edbcdadf10645bb5bfdebd9b1d939777c6 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 15 Oct 2018 11:21:44 -0400 Subject: [PATCH] API: Ignore expired blocks in ApiQueryBase::showHiddenUsersAddBlockInfo() This probably went unnoticed for so long because expired blocks are regularly cleared as long as new blocks continue being issued, so people found that the problem "fixed" itself. Bug: T206944 Change-Id: I6559e1ec23f4469d19684b4d931913acbccb56d4 --- includes/api/ApiQueryBase.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index b9ed9f2f45..8630561b2e 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -436,9 +436,14 @@ abstract class ApiQueryBase extends ApiBase { * @return void */ public function showHiddenUsersAddBlockInfo( $showBlockInfo ) { + $db = $this->getDB(); + $this->addTables( 'ipblocks' ); $this->addJoinConds( [ - 'ipblocks' => [ 'LEFT JOIN', 'ipb_user=user_id' ], + 'ipblocks' => [ 'LEFT JOIN', [ + 'ipb_user=user_id', + 'ipb_expiry > ' . $db->addQuotes( $db->timestamp() ), + ] ], ] ); $this->addFields( 'ipb_deleted' ); -- 2.20.1