summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2026-06-16 22:32:21 +0200
committerDaniel Weipert <git@mail.dweipert.de>2026-06-16 22:32:21 +0200
commit4304eecf3f9d53941cdd31d4bf6ae7a5039fe7b2 (patch)
tree55d59cdb1924d15e9fb39e9cf8f489040a20a91f
parent226faf34b0ec4e70d87c8fd8fca43955d1e92dda (diff)
fix scandir on non-git project directories
-rw-r--r--index.php7
1 files changed, 6 insertions, 1 deletions
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 {