X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryAllRevisions.php;h=3d4c49bb0f31b609a035dd5c55cbb24e2b35038d;hb=9283760f340c6971d748fb574a35453fa7928807;hp=17a6e00090b98015af6d8d9450ecfc3029b38461;hpb=0d6ef1c0b20093e03e95a6b7f303c7a2de5de3af;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryAllRevisions.php b/includes/api/ApiQueryAllRevisions.php index 17a6e00090..3d4c49bb0f 100644 --- a/includes/api/ApiQueryAllRevisions.php +++ b/includes/api/ApiQueryAllRevisions.php @@ -40,8 +40,6 @@ class ApiQueryAllRevisions extends ApiQueryRevisionsBase { * @return void */ protected function run( ApiPageSet $resultPageSet = null ) { - global $wgActorTableSchemaMigrationStage; - $db = $this->getDB(); $params = $this->extractRequestParams( false ); $services = MediaWikiServices::getInstance(); @@ -54,9 +52,7 @@ class ApiQueryAllRevisions extends ApiQueryRevisionsBase { $tsField = 'rev_timestamp'; $idField = 'rev_id'; $pageField = 'rev_page'; - if ( $params['user'] !== null && - ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW ) - ) { + if ( $params['user'] !== null ) { // The query is probably best done using the actor_timestamp index on // revision_actor_temp. Use the denormalized fields from that table. $tsField = 'revactor_timestamp'; @@ -156,7 +152,9 @@ class ApiQueryAllRevisions extends ApiQueryRevisionsBase { // Paranoia: avoid brute force searches (T19342) if ( !$this->getPermissionManager()->userHasRight( $this->getUser(), 'deletedhistory' ) ) { $bitmask = RevisionRecord::DELETED_USER; - } elseif ( !$this->getUser()->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) { + } elseif ( !$this->getPermissionManager() + ->userHasAnyRight( $this->getUser(), 'suppressrevision', 'viewsuppressed' ) + ) { $bitmask = RevisionRecord::DELETED_USER | RevisionRecord::DELETED_RESTRICTED; } else { $bitmask = 0;