(bug 23703) ForeignAPIRepo fails on findBySha1() when using a 1.14 install as a repos...
authorChad Horohoe <demon@users.mediawiki.org>
Sun, 22 Aug 2010 16:10:58 +0000 (16:10 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sun, 22 Aug 2010 16:10:58 +0000 (16:10 +0000)
RELEASE-NOTES
includes/filerepo/ForeignAPIRepo.php

index 6c7ae2b..fe40782 100644 (file)
@@ -299,6 +299,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 24804) Corrected commafying in Polish and Ukrainian
 * "Difference between pages" is now displayed instead of "Difference between
    revisions" on diffs when appropriate.
+* (bug 23703) ForeignAPIRepo fails on findBySha1() when using a 1.14 install as
+  a repository due to missing 'name' attribute from the API list=allimages
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent.
index 2c74ac2..24c7a92 100644 (file)
@@ -160,6 +160,10 @@ class ForeignAPIRepo extends FileRepo {
                $ret = array();
                if ( isset( $results['query']['allimages'] ) ) {
                        foreach ( $results['query']['allimages'] as $img ) {
+                               // 1.14 was broken, doesn't return name attribute
+                               if( !isset( $img['name'] ) ) {
+                                       continue;
+                               }
                                $ret[] = new ForeignAPIFile( Title::makeTitle( NS_FILE, $img['name'] ), $this, $img );
                        }
                }