diff options
Diffstat (limited to 'includes/api/ApiQueryFileRepoInfo.php')
-rw-r--r-- | includes/api/ApiQueryFileRepoInfo.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/includes/api/ApiQueryFileRepoInfo.php b/includes/api/ApiQueryFileRepoInfo.php index 279bc0a2f3eb..2b35c979c5ea 100644 --- a/includes/api/ApiQueryFileRepoInfo.php +++ b/includes/api/ApiQueryFileRepoInfo.php @@ -51,12 +51,14 @@ class ApiQueryFileRepoInfo extends ApiQueryBase { $repoGroup = $this->getInitialisedRepoGroup(); $foreignTargets = $conf->get( 'ForeignUploadTargets' ); - $repoGroup->forEachForeignRepo( function ( $repo ) use ( &$repos, $props, $foreignTargets ) { - $repoProps = $repo->getInfo(); - $repoProps['canUpload'] = in_array( $repoProps['name'], $foreignTargets ); + $repoGroup->forEachForeignRepo( + function ( FileRepo $repo ) use ( &$repos, $props, $foreignTargets ) { + $repoProps = $repo->getInfo(); + $repoProps['canUpload'] = in_array( $repoProps['name'], $foreignTargets ); - $repos[] = array_intersect_key( $repoProps, $props ); - } ); + $repos[] = array_intersect_key( $repoProps, $props ); + } + ); $localInfo = $repoGroup->getLocalRepo()->getInfo(); $localInfo['canUpload'] = $conf->get( 'EnableUploads' ); @@ -90,7 +92,7 @@ class ApiQueryFileRepoInfo extends ApiQueryBase { $props = []; $repoGroup = $this->getInitialisedRepoGroup(); - $repoGroup->forEachForeignRepo( function ( $repo ) use ( &$props ) { + $repoGroup->forEachForeignRepo( function ( FileRepo $repo ) use ( &$props ) { $props = array_merge( $props, array_keys( $repo->getInfo() ) ); } ); |