X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryAllDeletedRevisions.php;h=3073a951b0225a7cb8997ff4efa05debb4821796;hb=92d93c5d6dc6845600bd78ad668cfd9bbb1ac009;hp=a559683a33642cc415fdc0581ebb6039cead5bfc;hpb=58cb1f824ac75c3b58ba19d1e88c1b38f9dc1fab;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryAllDeletedRevisions.php b/includes/api/ApiQueryAllDeletedRevisions.php index a559683a33..3073a951b0 100644 --- a/includes/api/ApiQueryAllDeletedRevisions.php +++ b/includes/api/ApiQueryAllDeletedRevisions.php @@ -55,6 +55,14 @@ class ApiQueryAllDeletedRevisions extends ApiQueryRevisionsBase { $result = $this->getResult(); + // If the user wants no namespaces, they get no pages. + if ( $params['namespace'] === [] ) { + if ( $resultPageSet === null ) { + $result->addValue( 'query', $this->getModuleName(), [] ); + } + return; + } + // This module operates in two modes: // 'user': List deleted revs by a certain user // 'all': List all deleted revs in NS @@ -153,10 +161,10 @@ class ApiQueryAllDeletedRevisions extends ApiQueryRevisionsBase { if ( $mode == 'all' ) { if ( $params['namespace'] !== null ) { $namespaces = $params['namespace']; - $this->addWhereFld( 'ar_namespace', $namespaces ); } else { $namespaces = MWNamespace::getValidNamespaces(); } + $this->addWhereFld( 'ar_namespace', $namespaces ); // For from/to/prefix, we have to consider the potential // transformations of the title in all specified namespaces. @@ -447,7 +455,7 @@ class ApiQueryAllDeletedRevisions extends ApiQueryRevisionsBase { return [ 'action=query&list=alldeletedrevisions&adruser=Example&adrlimit=50' => 'apihelp-query+alldeletedrevisions-example-user', - 'action=query&list=alldeletedrevisions&adrdir=newer&adrlimit=50' + 'action=query&list=alldeletedrevisions&adrdir=newer&adrnamespace=0&adrlimit=50' => 'apihelp-query+alldeletedrevisions-example-ns-main', ]; }