r50215 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50214‎ | r50215 | r50216 >
Date:09:47, 5 May 2009
Author:catrope
Status:ok
Tags:
Comment:
Fix up r47473: descend into subarrays in ForeignAPIFile::getMetadata()
Modified paths:
  • /trunk/phase3/includes/filerepo/ForeignAPIFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/ForeignAPIFile.php
@@ -60,15 +60,22 @@
6161
6262 public function getMetadata() {
6363 if ( isset( $this->mInfo['metadata'] ) ) {
64 - $ret = array();
65 - foreach( $this->mInfo['metadata'] as $meta ) {
66 - $ret[ $meta['name'] ] = $meta['value'];
67 - }
68 - return serialize( $ret );
 64+ return serialize( self::parseMetadata( $this->mInfo['metadata'] ) );
6965 }
7066 return null;
7167 }
7268
 69+ public static function parseMetadata( $metadata ) {
 70+ if( !is_array( $metadata ) ) {
 71+ return $metadata;
 72+ }
 73+ $ret = array();
 74+ foreach( $metadata as $meta ) {
 75+ $ret[ $meta['name'] ] = self::parseMetadata( $meta['value'] );
 76+ }
 77+ return $ret;
 78+ }
 79+
7380 public function getSize() {
7481 return intval( @$this->mInfo['size'] );
7582 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r50222Backports:...tstarling14:18, 5 May 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r47473Fix regression in ForeignAPIRepo because somebody changed how the API returne...demon23:21, 18 February 2009

Status & tagging log