API: Remove metadata keys from indexpageids output
authorBrad Jorsch <bjorsch@wikimedia.org>
Thu, 23 Apr 2015 13:13:42 +0000 (09:13 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Thu, 23 Apr 2015 13:17:56 +0000 (09:17 -0400)
While we could fix the issue at hand by moving the setArrayType() call,
it's more robust to explicitly remove *all* metadata.

Bug: T96942
Change-Id: I313b19339474ea34880ebef31851eefdf14a7a07

includes/api/ApiQuery.php

index 082fccb..bfe3205 100644 (file)
@@ -448,7 +448,7 @@ class ApiQuery extends ApiBase {
                        ApiResult::setArrayType( $pages, 'BCarray' );
 
                        if ( $this->mParams['indexpageids'] ) {
-                               $pageIDs = array_keys( $pages );
+                               $pageIDs = array_keys( ApiResult::stripMetadataNonRecursive( $pages ) );
                                // json treats all map keys as strings - converting to match
                                $pageIDs = array_map( 'strval', $pageIDs );
                                ApiResult::setIndexedTagName( $pageIDs, 'id' );