Skip to content

Commit 6f48f2f

Browse files
committed
fix: Ensure app discover section is returned as list
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent 12ed773 commit 6f48f2f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function get($allowUnstable = false) {
5050
$entries = parent::get(false);
5151
$now = new DateTimeImmutable();
5252

53-
return array_filter($entries, function (array $entry) use ($now, $allowUnstable) {
53+
$entires = array_filter($entries, function (array $entry) use ($now, $allowUnstable) {
5454
// Always remove expired entries
5555
if (isset($entry['expiryDate'])) {
5656
try {
@@ -79,6 +79,9 @@ public function get($allowUnstable = false) {
7979
// Otherwise the entry is not time limited and should stay
8080
return true;
8181
});
82+
83+
// Make sure the indices are sequential again after filtering
84+
return array_values($entries);
8285
}
8386

8487
public function getETag(): ?string {

0 commit comments

Comments
 (0)