X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryAllRevisions.php;h=3d4c49bb0f31b609a035dd5c55cbb24e2b35038d;hb=5a451fd01be397db3209c1881a335423706da5c2;hp=58445a1faaf2afcbeea73dbb43c8e4967f1c1ecc;hpb=86c13ba3ad15f7ab4c567b30c2810fe36db102df;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryAllRevisions.php b/includes/api/ApiQueryAllRevisions.php index 58445a1faa..3d4c49bb0f 100644 --- a/includes/api/ApiQueryAllRevisions.php +++ b/includes/api/ApiQueryAllRevisions.php @@ -40,11 +40,10 @@ class ApiQueryAllRevisions extends ApiQueryRevisionsBase { * @return void */ protected function run( ApiPageSet $resultPageSet = null ) { - global $wgActorTableSchemaMigrationStage; - $db = $this->getDB(); $params = $this->extractRequestParams( false ); - $revisionStore = MediaWikiServices::getInstance()->getRevisionStore(); + $services = MediaWikiServices::getInstance(); + $revisionStore = $services->getRevisionStore(); $result = $this->getResult(); @@ -53,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'; @@ -70,7 +67,7 @@ class ApiQueryAllRevisions extends ApiQueryRevisionsBase { if ( $params['namespace'] !== null ) { $params['namespace'] = array_unique( $params['namespace'] ); sort( $params['namespace'] ); - if ( $params['namespace'] != MWNamespace::getValidNamespaces() ) { + if ( $params['namespace'] != $services->getNamespaceInfo()->getValidNamespaces() ) { $needPageTable = true; if ( $this->getConfig()->get( 'MiserMode' ) ) { $miser_ns = $params['namespace']; @@ -153,9 +150,11 @@ class ApiQueryAllRevisions extends ApiQueryRevisionsBase { if ( $params['user'] !== null || $params['excludeuser'] !== null ) { // Paranoia: avoid brute force searches (T19342) - if ( !$this->getUser()->isAllowed( 'deletedhistory' ) ) { + 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;