From 8585b053574c0f9cc3d34c1b064688012e060b28 Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Mon, 9 Sep 2024 19:50:11 +0200 Subject: [PATCH 1/2] fix(appstore): Ensure returned apps from AppStore are valid Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: lint chore: remove space Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: check if response array is null Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> chore: Add log --- lib/private/App/AppStore/Fetcher/AppFetcher.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index ae36d849c5ef1..d2c98c4afc965 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -53,7 +53,8 @@ protected function fetch($ETag, $content, $allowUnstable = false) { /** @var mixed[] $response */ $response = parent::fetch($ETag, $content); - if (empty($response)) { + if (empty($response) || $response['data'] === null) { + $this->logger->warning('Response from appstore is invalid, apps could not be retrieved. Try again later.', ['app' => 'appstoreFetcher']); return []; } From dccfb6d68ac7192b1bedcdfdbc077e28fab22605 Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Fri, 13 Sep 2024 09:49:09 +0200 Subject: [PATCH 2/2] fix: check if key is set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com> Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- lib/private/App/AppStore/Fetcher/AppFetcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index d2c98c4afc965..5414358250fc4 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -53,7 +53,7 @@ protected function fetch($ETag, $content, $allowUnstable = false) { /** @var mixed[] $response */ $response = parent::fetch($ETag, $content); - if (empty($response) || $response['data'] === null) { + if (!isset($response['data']) || $response['data'] === null) { $this->logger->warning('Response from appstore is invalid, apps could not be retrieved. Try again later.', ['app' => 'appstoreFetcher']); return []; }