Index: trunk/phase3/includes/api/ApiFormatXml.php |
— | — | @@ -83,6 +83,13 @@ |
84 | 84 | |
85 | 85 | switch (gettype($elemValue)) { |
86 | 86 | case 'array' : |
| 87 | + if (isset ($elemValue['_attribs'])) { |
| 88 | + $attribValues = $elemValue['_attribs']; |
| 89 | + unset( $elemValue['_attribs'] ); |
| 90 | + } else { |
| 91 | + $attribValues = null; |
| 92 | + } |
| 93 | + |
87 | 94 | if (isset ($elemValue['*'])) { |
88 | 95 | $subElemContent = $elemValue['*']; |
89 | 96 | if ($this->mDoubleQuote) |
— | — | @@ -113,6 +120,8 @@ |
114 | 121 | unset ($elemValue[$subElemId]); |
115 | 122 | } |
116 | 123 | } |
| 124 | + |
| 125 | + $elemValue = wfArrayMerge( $attribValues, $elemValue ); // wtf |
117 | 126 | |
118 | 127 | if (is_null($subElemIndName) && !empty ($indElements)) |
119 | 128 | ApiBase :: dieDebug(__METHOD__, "($elemName, ...) has integer keys without _element value. Use ApiResult::setIndexedTagName()."); |
— | — | @@ -123,7 +132,7 @@ |
124 | 133 | if (!is_null($subElemContent)) { |
125 | 134 | $this->printText($indstr . wfElement($elemName, $elemValue, $subElemContent)); |
126 | 135 | } elseif (empty ($indElements) && empty ($subElements)) { |
127 | | - $this->printText($indstr . wfElement($elemName, $elemValue)); |
| 136 | + $this->printText($indstr . wfElement($elemName, $elemValue)); |
128 | 137 | } else { |
129 | 138 | $this->printText($indstr . wfElement($elemName, $elemValue, null)); |
130 | 139 | |