From: Chad Horohoe Date: Mon, 18 Apr 2011 17:04:50 +0000 (+0000) Subject: Per CR on r78824 (#c12467): Some query pages are useless/redundant, since we already... X-Git-Tag: 1.31.0-rc.0~30733 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=767fd9aa13baf06d3ea8a076e4ddae8c7ea5628b;p=lhc%2Fweb%2Fwiklou.git 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. --- 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]; + } } }