From 4304eecf3f9d53941cdd31d4bf6ae7a5039fe7b2 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Tue, 16 Jun 2026 22:32:21 +0200 Subject: fix scandir on non-git project directories --- index.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 87b0845..bb2418f 100644 --- a/index.php +++ b/index.php @@ -18,7 +18,12 @@ function find_projects(string $path, array $projects = []): array { $projects[] = $path; } else { - if (count(array_intersect(scandir($path), ["HEAD", "objects", "refs"])) == 3) { + $scan = @scandir($path); + if (! $scan) { + return $projects; + } + + if (count(array_intersect($scan, ["HEAD", "objects", "refs"])) == 3) { $projects[] = $path; } else { -- cgit v1.2.3