Fix regression in ForeignAPIRepo because somebody changed how the API returned data :)
authorChad Horohoe <demon@users.mediawiki.org>
Wed, 18 Feb 2009 23:21:51 +0000 (23:21 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Wed, 18 Feb 2009 23:21:51 +0000 (23:21 +0000)
includes/filerepo/ForeignAPIFile.php

index bcea32c..0a29367 100644 (file)
@@ -59,7 +59,14 @@ class ForeignAPIFile extends File {
        }
        
        public function getMetadata() {
-               return serialize( (array)@$this->mInfo['metadata'] );
+               if ( isset( $this->mInfo['metadata'] ) ) {
+                       $ret = array();
+                       foreach( $this->mInfo['metadata'] as $meta ) {
+                               $ret[ $meta['name'] ] = $meta['value'];
+                       }
+                       return serialize( $ret );
+               }
+               return null;
        }
        
        public function getSize() {