From: Brion Vibber Date: Fri, 4 Jul 2008 22:44:57 +0000 (+0000) Subject: Revert r37009 -- turns out you can do these structures, it's just very nonobvious. :) X-Git-Tag: 1.31.0-rc.0~46732 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=dae4d46723c962b4d4b25cba53706225c49915c9;p=lhc%2Fweb%2Fwiklou.git Revert r37009 -- turns out you can do these structures, it's just very nonobvious. :) An anonymous sub-array allows creating sub-elements in addition to the attributes: array( 'attrib1' => 'val1', 'attrib2' => 'val2', array( 'tag' => 'stuff', 'tag2' => 'stuff2', ) ) --- diff --git a/includes/api/ApiFormatXml.php b/includes/api/ApiFormatXml.php index 928e4b9c59..b1194171bc 100644 --- a/includes/api/ApiFormatXml.php +++ b/includes/api/ApiFormatXml.php @@ -83,13 +83,6 @@ class ApiFormatXml extends ApiFormatBase { switch (gettype($elemValue)) { case 'array' : - if (isset ($elemValue['_attribs'])) { - $attribValues = $elemValue['_attribs']; - unset( $elemValue['_attribs'] ); - } else { - $attribValues = null; - } - if (isset ($elemValue['*'])) { $subElemContent = $elemValue['*']; if ($this->mDoubleQuote) @@ -120,8 +113,6 @@ class ApiFormatXml extends ApiFormatBase { unset ($elemValue[$subElemId]); } } - - $elemValue = wfArrayMerge( $attribValues, $elemValue ); // wtf if (is_null($subElemIndName) && !empty ($indElements)) ApiBase :: dieDebug(__METHOD__, "($elemName, ...) has integer keys without _element value. Use ApiResult::setIndexedTagName()."); @@ -132,7 +123,7 @@ class ApiFormatXml extends ApiFormatBase { if (!is_null($subElemContent)) { $this->printText($indstr . wfElement($elemName, $elemValue, $subElemContent)); } elseif (empty ($indElements) && empty ($subElements)) { - $this->printText($indstr . wfElement($elemName, $elemValue)); + $this->printText($indstr . wfElement($elemName, $elemValue)); } else { $this->printText($indstr . wfElement($elemName, $elemValue, null));