array( &$this, $categories, &$this->mCategoryLinks ) )
) {
foreach ( $categories as $category => $type ) {
+ // array keys will cast numeric category names to ints, so cast back to string
+ $category = (string)$category;
$origcategory = $category;
$title = Title::makeTitleSafe( NS_CATEGORY, $category );
if ( !$title ) {
foreach ( $categories as $category => $sortkey ) {
$entry = array();
$entry['sortkey'] = $sortkey;
- ApiResult::setContentValue( $entry, 'category', $category );
+ ApiResult::setContentValue( $entry, 'category', (string)$category );
$categories_result[] = $entry;
}
ApiResult::setIndexedTagName( $categories_result, 'category' );
foreach ( $links as $link => $sortkey ) {
$entry = array();
$entry['sortkey'] = $sortkey;
- ApiResult::setContentValue( $entry, 'category', $link );
+ // array keys will cast numeric category names to ints, so cast back to string
+ ApiResult::setContentValue( $entry, 'category', (string)$link );
if ( !isset( $hiddencats[$link] ) ) {
$entry['missing'] = true;
} elseif ( $hiddencats[$link] ) {