diff options
author | Julius Härtl <jus@bitgrid.net> | 2024-03-04 09:44:19 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-03-04 20:17:01 +0000 |
commit | a258abfe5940fa70edde9932c817b0dbcf72883c (patch) | |
tree | de0af8dbe2288b6734d424db162a7e79ef871f80 /lib | |
parent | a14ec0ace63db04966ba6ad596b88ce369c7987b (diff) | |
download | nextcloud-server-a258abfe5940fa70edde9932c817b0dbcf72883c.tar.gz nextcloud-server-a258abfe5940fa70edde9932c817b0dbcf72883c.zip |
fix: Fetch custom app store url without internet connection
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/App/AppStore/Fetcher/Fetcher.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php index a693804f50f..4f1250d4eb7 100644 --- a/lib/private/App/AppStore/Fetcher/Fetcher.php +++ b/lib/private/App/AppStore/Fetcher/Fetcher.php @@ -44,6 +44,7 @@ use Psr\Log\LoggerInterface; abstract class Fetcher { public const INVALIDATE_AFTER_SECONDS = 3600; public const RETRY_AFTER_FAILURE_SECONDS = 300; + public const APP_STORE_URL = 'https://apps.nextcloud.com/api/v1'; /** @var IAppData */ protected $appData; @@ -109,7 +110,7 @@ abstract class Fetcher { ]; } - if ($this->config->getSystemValueString('appstoreurl', 'https://apps.nextcloud.com/api/v1') === 'https://apps.nextcloud.com/api/v1') { + if ($this->config->getSystemValueString('appstoreurl', self::APP_STORE_URL) === self::APP_STORE_URL) { // If we have a valid subscription key, send it to the appstore $subscriptionKey = $this->config->getAppValue('support', 'subscription_key'); if ($this->registry->delegateHasValidSubscription() && $subscriptionKey) { @@ -153,8 +154,9 @@ abstract class Fetcher { public function get($allowUnstable = false) { $appstoreenabled = $this->config->getSystemValueBool('appstoreenabled', true); $internetavailable = $this->config->getSystemValueBool('has_internet_connection', true); + $isDefaultAppStore = $this->config->getSystemValueString('appstoreurl', self::APP_STORE_URL) === self::APP_STORE_URL; - if (!$appstoreenabled || !$internetavailable) { + if (!$appstoreenabled || (!$internetavailable && $isDefaultAppStore)) { return []; } |