From 767fd9aa13baf06d3ea8a076e4ddae8c7ea5628b Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 18 Apr 2011 17:04:50 +0000 Subject: [PATCH] Per CR on r78824 (#c12467): Some query pages are useless/redundant, since we already output them elsewhere in the API, so we shouldn't expose them. --- includes/api/ApiQueryQueryPage.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/includes/api/ApiQueryQueryPage.php b/includes/api/ApiQueryQueryPage.php index b09ffa24e1..fb72e7e0c0 100644 --- a/includes/api/ApiQueryQueryPage.php +++ b/includes/api/ApiQueryQueryPage.php @@ -37,6 +37,15 @@ if ( !defined( 'MEDIAWIKI' ) ) { class ApiQueryQueryPage extends ApiQueryGeneratorBase { private $qpMap; + /** + * Some query pages are useless because they're available elsewhere in the API + */ + private $uselessQueryPages = array( + 'MIMEsearch', // aiprop=mime + 'LinkSearch', // list=exturlusage + 'FileDuplicateSearch', // prop=duplicatefiles + ); + public function __construct( $query, $moduleName ) { parent::__construct( $query, $moduleName, 'qp' ); // We need to do this to make sure $wgQueryPages is set up @@ -48,7 +57,9 @@ class ApiQueryQueryPage extends ApiQueryGeneratorBase { global $wgQueryPages; $this->qpMap = array(); foreach ( $wgQueryPages as $page ) { - $this->qpMap[$page[1]] = $page[0]; + if( !in_array( $page[1], $this->uselessQueryPages ) ) { + $this->qpMap[$page[1]] = $page[0]; + } } } -- 2.20.1