(bug 23703) ForeignAPIRepo fails on findBySha1() when using a 1.14 install as a repos...
[lhc/web/wiklou.git] / includes / filerepo / ForeignAPIRepo.php
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 );
                        }
                }