X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryAllDeletedRevisions.php;h=85ca6480f15486ae2a33e8d4992f1d6f0d744358;hb=8963110d01b0f376d900171fe7506fed5df80cf8;hp=8855615755a924a889ddc06046ae89f626249dfa;hpb=d6e366a318a2fedf88533456b71f91cb5c52c5e6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryAllDeletedRevisions.php b/includes/api/ApiQueryAllDeletedRevisions.php index 8855615755..85ca6480f1 100644 --- a/includes/api/ApiQueryAllDeletedRevisions.php +++ b/includes/api/ApiQueryAllDeletedRevisions.php @@ -49,7 +49,8 @@ class ApiQueryAllDeletedRevisions extends ApiQueryRevisionsBase { $user = $this->getUser(); $db = $this->getDB(); $params = $this->extractRequestParams( false ); - $revisionStore = MediaWikiServices::getInstance()->getRevisionStore(); + $services = MediaWikiServices::getInstance(); + $revisionStore = $services->getRevisionStore(); $result = $this->getResult(); @@ -131,7 +132,7 @@ class ApiQueryAllDeletedRevisions extends ApiQueryRevisionsBase { if ( !is_null( $params['tag'] ) ) { $this->addTables( 'change_tag' ); $this->addJoinConds( - [ 'change_tag' => [ 'INNER JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ] + [ 'change_tag' => [ 'JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ] ); $changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore(); try { @@ -142,21 +143,16 @@ class ApiQueryAllDeletedRevisions extends ApiQueryRevisionsBase { } } + // This means stricter restrictions if ( $this->fetchContent ) { - $this->addTables( 'text' ); - $this->addJoinConds( - [ 'text' => [ 'LEFT JOIN', [ 'ar_text_id=old_id' ] ] ] - ); - $this->addFields( [ 'old_text', 'old_flags' ] ); - - // This also means stricter restrictions $this->checkUserRightsAny( [ 'deletedtext', 'undelete' ] ); } $miser_ns = null; if ( $mode == 'all' ) { - $namespaces = $params['namespace'] ?? MWNamespace::getValidNamespaces(); + $namespaces = $params['namespace'] ?? + $services->getNamespaceInfo()->getValidNamespaces(); $this->addWhereFld( 'ar_namespace', $namespaces ); // For from/to/prefix, we have to consider the potential