From bd248450a251bb59a5ac23d65e7abd4e59ccdda1 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sun, 22 Aug 2010 16:10:58 +0000 Subject: [PATCH] (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 --- RELEASE-NOTES | 2 ++ includes/filerepo/ForeignAPIRepo.php | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6c7ae2bbd4..fe40782166 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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. diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index 2c74ac2879..24c7a92d09 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -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 ); } } -- 2.20.1