From: Chad Horohoe Date: Sun, 22 Aug 2010 16:10:58 +0000 (+0000) Subject: (bug 23703) ForeignAPIRepo fails on findBySha1() when using a 1.14 install as a repos... X-Git-Tag: 1.31.0-rc.0~35380 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=bd248450a251bb59a5ac23d65e7abd4e59ccdda1;p=lhc%2Fweb%2Fwiklou.git (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 --- 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 ); } }