X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryDeletedRevisions.php;h=c15634153db2ef70da54ecadcf9cb2b4f3f5cede;hb=a10838acba3b0bc76d5fe28ecfd7a9be98ab01c8;hp=8f71c1c4d7616aea4d0e6c03093618421cb3b7cb;hpb=6ac8c496d16c1f88d1b8b4cf449085301ddefdce;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryDeletedRevisions.php b/includes/api/ApiQueryDeletedRevisions.php index 8f71c1c4d7..c15634153d 100644 --- a/includes/api/ApiQueryDeletedRevisions.php +++ b/includes/api/ApiQueryDeletedRevisions.php @@ -39,8 +39,6 @@ class ApiQueryDeletedRevisions extends ApiQueryRevisionsBase { } protected function run( ApiPageSet $resultPageSet = null ) { - global $wgChangeTagsSchemaMigrationStage; - $user = $this->getUser(); // Before doing anything at all, let's check permissions $this->checkUserRightsAny( 'deletedhistory' ); @@ -79,11 +77,7 @@ class ApiQueryDeletedRevisions extends ApiQueryRevisionsBase { } if ( $this->fld_tags ) { - $this->addTables( 'tag_summary' ); - $this->addJoinConds( - [ 'tag_summary' => [ 'LEFT JOIN', [ 'ar_rev_id=ts_rev_id' ] ] ] - ); - $this->addFields( 'ts_tags' ); + $this->addFields( [ 'ts_tags' => ChangeTags::makeTagSummarySubquery( 'archive' ) ] ); } if ( !is_null( $params['tag'] ) ) { @@ -91,16 +85,12 @@ class ApiQueryDeletedRevisions extends ApiQueryRevisionsBase { $this->addJoinConds( [ 'change_tag' => [ 'INNER JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ] ); - if ( $wgChangeTagsSchemaMigrationStage > MIGRATION_WRITE_BOTH ) { - $changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore(); - try { - $this->addWhereFld( 'ct_tag_id', $changeTagDefStore->getId( $params['tag'] ) ); - } catch ( NameTableAccessException $exception ) { - // Return nothing. - $this->addWhere( '1=0' ); - } - } else { - $this->addWhereFld( 'ct_tag', $params['tag'] ); + $changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore(); + try { + $this->addWhereFld( 'ct_tag_id', $changeTagDefStore->getId( $params['tag'] ) ); + } catch ( NameTableAccessException $exception ) { + // Return nothing. + $this->addWhere( '1=0' ); } } @@ -165,7 +155,7 @@ class ApiQueryDeletedRevisions extends ApiQueryRevisionsBase { $op = ( $dir == 'newer' ? '>' : '<' ); if ( $revCount !== 0 ) { $this->dieContinueUsageIf( count( $cont ) != 2 ); - $rev = intval( $cont[0] ); + $rev = (int)$cont[0]; $this->dieContinueUsageIf( strval( $rev ) !== $cont[0] ); $ar_id = (int)$cont[1]; $this->dieContinueUsageIf( strval( $ar_id ) !== $cont[1] ); @@ -174,7 +164,7 @@ class ApiQueryDeletedRevisions extends ApiQueryRevisionsBase { "ar_id $op= $ar_id)" ); } else { $this->dieContinueUsageIf( count( $cont ) != 4 ); - $ns = intval( $cont[0] ); + $ns = (int)$cont[0]; $this->dieContinueUsageIf( strval( $ns ) !== $cont[0] ); $title = $db->addQuotes( $cont[1] ); $ts = $db->addQuotes( $db->timestamp( $cont[2] ) );