Skip to content

Commit ef4b1c3

Browse files
authored
Merge pull request #47870 from nextcloud/backport/47834/stable28
2 parents c0eff12 + bae0b8f commit ef4b1c3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/private/App/AppStore/Fetcher/AppFetcher.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,17 @@ public function setVersion(string $version, string $fileName = 'apps.json', bool
181181
$this->ignoreMaxVersion = $ignoreMaxVersion;
182182
}
183183

184-
185-
public function get($allowUnstable = false) {
184+
public function get($allowUnstable = false): array {
186185
$allowPreReleases = $allowUnstable || $this->getChannel() === 'beta' || $this->getChannel() === 'daily' || $this->getChannel() === 'git';
187186

187+
$appStoreEnabled = $this->config->getSystemValueBool('appstoreenabled', true);
188+
$internetAvailable = $this->config->getSystemValueBool('has_internet_connection', true);
189+
190+
if (!$appStoreEnabled || !$internetAvailable) {
191+
$this->logger->info('AppStore is disabled or this instance has no Internet connection', ['app' => 'appstoreFetcher']);
192+
return [];
193+
}
194+
188195
$apps = parent::get($allowPreReleases);
189196
if (empty($apps)) {
190197
$this->logger->warning('Could not get apps from the appstore', ['app' => 'appstoreFetcher']);

0 commit comments

Comments
 (0)