Followup r87150
authorSam Reed <reedy@users.mediawiki.org>
Sat, 30 Apr 2011 16:52:28 +0000 (16:52 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 30 Apr 2011 16:52:28 +0000 (16:52 +0000)
Reuse SpecialVersions arrayToString (made it explicitly public!) in an array_amp for the formatting of arrays/objects (Yay for all the different ways we accept things ;P)

includes/api/ApiQuerySiteinfo.php
includes/specials/SpecialVersion.php

index dde27a5..ed277b9 100644 (file)
@@ -510,7 +510,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                foreach ( $myWgHooks as $hook => $hooks )  {
                        $arr = array(
                                'name' => $hook,
-                               'subscribers' => $hooks,
+                               'subscribers' => array_map( array( 'SpecialVersion', 'arrayToString' ), $hooks ),
                        );
 
                        $this->getResult()->setIndexedTagName( $arr['subscribers'], 's' );
index 24d8908..2a727e6 100644 (file)
@@ -564,9 +564,10 @@ class SpecialVersion extends SpecialPage {
         *
         * @return Mixed
         */
-       static function arrayToString( $list ) {
-               if( is_array( $list ) && count( $list ) == 1 )
+       public static function arrayToString( $list ) {
+               if( is_array( $list ) && count( $list ) == 1 ) {
                        $list = $list[0];
+               }
                if( is_object( $list ) ) {
                        $class = get_class( $list );
                        return "($class)";