From fd1f762901cc1a20f40dc7f1ca2ebe6e6772d7fe Mon Sep 17 00:00:00 2001 From: GGedde Date: Mon, 27 May 2024 12:01:45 -0700 Subject: [PATCH] Update Env.php I have $_ENV disabled on my server as I only need environment variables accessible from getenv(). Unfortunately using array_key_exists() throws an error since $_ENV does not exist. So this commit resolves that. --- src/Env.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Env.php b/src/Env.php index b22cf25..379c8e1 100644 --- a/src/Env.php +++ b/src/Env.php @@ -76,11 +76,11 @@ public static function cleanCompileDir() */ private static function getEnvVariable($name) { - if (array_key_exists($name, $_SERVER)) { + if (!empty($_SERVER) && array_key_exists($name, $_SERVER)) { return $_SERVER[$name]; } - if (array_key_exists($name, $_ENV)) { + if (!empty($_ENV) && array_key_exists($name, $_ENV)) { return $_ENV[$name]; }