Index: trunk/phase3/includes/api/ApiQueryImageInfo.php |
— | — | @@ -224,14 +224,16 @@ |
225 | 225 | public static function processMetaData($metadata, $result) |
226 | 226 | { |
227 | 227 | $retval = array(); |
228 | | - foreach($metadata as $key => $value) |
229 | | - { |
230 | | - $r = array('name' => $key); |
231 | | - if(is_array($value)) |
232 | | - $r['value'] = self::processMetaData($value, $result); |
233 | | - else |
234 | | - $r['value'] = $value; |
235 | | - $retval[] = $r; |
| 228 | + if ( is_array( $metadata ) ) { |
| 229 | + foreach($metadata as $key => $value) |
| 230 | + { |
| 231 | + $r = array('name' => $key); |
| 232 | + if(is_array($value)) |
| 233 | + $r['value'] = self::processMetaData($value, $result); |
| 234 | + else |
| 235 | + $r['value'] = $value; |
| 236 | + $retval[] = $r; |
| 237 | + } |
236 | 238 | } |
237 | 239 | $result->setIndexedTagName($retval, 'metadata'); |
238 | 240 | return $retval; |