Skip to content

Commit

Permalink
fix: Ensure app discover section is returned as list
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Sep 24, 2024
1 parent 12ed773 commit 6f48f2f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/private/App/AppStore/Fetcher/AppDiscoverFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function get($allowUnstable = false) {
$entries = parent::get(false);
$now = new DateTimeImmutable();

return array_filter($entries, function (array $entry) use ($now, $allowUnstable) {
$entires = array_filter($entries, function (array $entry) use ($now, $allowUnstable) {
// Always remove expired entries
if (isset($entry['expiryDate'])) {
try {
Expand Down Expand Up @@ -79,6 +79,9 @@ public function get($allowUnstable = false) {
// Otherwise the entry is not time limited and should stay
return true;
});

// Make sure the indices are sequential again after filtering
return array_values($entries);
}

public function getETag(): ?string {
Expand Down

0 comments on commit 6f48f2f

Please sign in to comment.