Also set the queue types map when rebuilding the ready queue map
[lhc/web/wiklou.git] / includes / api / ApiFormatXml.php
index 764e609..b3d5937 100644 (file)
@@ -111,9 +111,9 @@ class ApiFormatXml extends ApiFormatBase {
         * @note The method is recursive, so the same rules apply to any
         * sub-arrays.
         *
-        * @param $elemName
-        * @param $elemValue
-        * @param $indent
+        * @param string $elemName
+        * @param mixed $elemValue
+        * @param int $indent
         *
         * @return string
         */
@@ -147,6 +147,15 @@ class ApiFormatXml extends ApiFormatBase {
                                $subElemIndName = null;
                        }
 
+                       if ( isset( $elemValue['_subelements'] ) ) {
+                               foreach ( $elemValue['_subelements'] as $subElemId ) {
+                                       if ( isset( $elemValue[$subElemId] ) && !is_array( $elemValue[$subElemId] ) ) {
+                                               $elemValue[$subElemId] = array( '*' => $elemValue[$subElemId] );
+                                       }
+                               }
+                               unset( $elemValue['_subelements'] );
+                       }
+
                        $indElements = array();
                        $subElements = array();
                        foreach ( $elemValue as $subElemId => & $subElemValue ) {