Index: trunk/phase3/includes/api/ApiFormatXml.php |
— | — | @@ -106,14 +106,6 @@ |
107 | 107 | if (is_string($subElemValue) && $this->mDoubleQuote) |
108 | 108 | $subElemValue = $this->doubleQuote($subElemValue); |
109 | 109 | |
110 | | - // Replace spaces with underscores |
111 | | - $newSubElemId = str_replace(' ', '_', $subElemId); |
112 | | - if($newSubElemId != $subElemId) { |
113 | | - $elemValue[$newSubElemId] = $subElemValue; |
114 | | - unset($elemValue[$subElemId]); |
115 | | - $subElemId = $newSubElemId; |
116 | | - } |
117 | | - |
118 | 110 | if (gettype($subElemId) === 'integer') { |
119 | 111 | $indElements[] = $subElemValue; |
120 | 112 | unset ($elemValue[$subElemId]); |
Index: trunk/phase3/includes/api/ApiQueryImageInfo.php |
— | — | @@ -140,8 +140,7 @@ |
141 | 141 | $vals['sha1'] = wfBaseConvert( $file->getSha1(), 36, 16, 40 ); |
142 | 142 | if( isset( $prop['metadata'] ) ) { |
143 | 143 | $metadata = $file->getMetadata(); |
144 | | - $vals['metadata'] = $metadata ? unserialize( $metadata ) : null; |
145 | | - $result->setIndexedTagName_recursive( $vals['metadata'], 'meta' ); |
| 144 | + $vals['metadata'] = $metadata ? self::processMetaData( unserialize( $metadata ), $result ) : null; |
146 | 145 | } |
147 | 146 | if( isset( $prop['mime'] ) ) |
148 | 147 | $vals['mime'] = $file->getMimeType(); |
— | — | @@ -154,6 +153,22 @@ |
155 | 154 | |
156 | 155 | return $vals; |
157 | 156 | } |
| 157 | + |
| 158 | + public static function processMetaData($metadata, $result) |
| 159 | + { |
| 160 | + $retval = array(); |
| 161 | + foreach($metadata as $key => $value) |
| 162 | + { |
| 163 | + $r = array('name' => $key); |
| 164 | + if(is_array($value)) |
| 165 | + $r['value'] = self::processMetaData($value, $result); |
| 166 | + else |
| 167 | + $r['value'] = $value; |
| 168 | + $retval[] = $r; |
| 169 | + } |
| 170 | + $result->setIndexedTagName($retval, 'metadata'); |
| 171 | + return $retval; |
| 172 | + } |
158 | 173 | |
159 | 174 | public function getAllowedParams() { |
160 | 175 | return array ( |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -156,6 +156,7 @@ |
157 | 157 | * (bug 17239) Added prop=displaytitle to action=parse |
158 | 158 | * (bug 17317) Added watch parameter to action=protect |
159 | 159 | * (bug 17007) Added export and exportnowrap parameters to action=query |
| 160 | +* (bug 17326) BREAKING CHANGE: Changed output format for iiprop=metadata |
160 | 161 | |
161 | 162 | === Languages updated in 1.15 === |
162 | 163 | |