diff --git a/src/whitelist.php b/src/whitelist.php index 21114834..fb528636 100644 --- a/src/whitelist.php +++ b/src/whitelist.php @@ -8,6 +8,11 @@ */ function isWhitelisted(string $user): bool { - $whitelist = array_map("trim", array_filter(explode(",", $_SERVER["WHITELIST"] ?? ""))); + $whitelistRaw = $_ENV["WHITELIST"] ?? $_SERVER["WHITELIST"] ?? null; + if ($whitelistRaw === null) { + $whitelistRaw = getenv("WHITELIST"); + $whitelistRaw = $whitelistRaw === false ? "" : $whitelistRaw; + } + $whitelist = array_map("trim", array_filter(explode(",", $whitelistRaw))); return empty($whitelist) || in_array($user, $whitelist, true); }