From: Brad Jorsch Date: Mon, 15 Oct 2018 15:21:44 +0000 (-0400) Subject: API: Ignore expired blocks in ApiQueryBase::showHiddenUsersAddBlockInfo() X-Git-Tag: 1.34.0-rc.0~3767^2 X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=commitdiff_plain;h=377c76edbcdadf10645bb5bfdebd9b1d939777c6;p=lhc%2Fweb%2Fwiklou.git 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 --- 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' );