From dae4d46723c962b4d4b25cba53706225c49915c9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 4 Jul 2008 22:44:57 +0000 Subject: [PATCH] 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', ) ) --- includes/api/ApiFormatXml.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) 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)); -- 2.20.1