From 3668e6552c73bacc6d25a1c9f84b2dc8be849377 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Fri, 6 Jan 2023 10:13:20 +0900 Subject: [PATCH] Extra check to make sure _ENV array is inited before appending to it --- src/DotEnv.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/DotEnv.php b/src/DotEnv.php index a75dd71..9a02ec0 100644 --- a/src/DotEnv.php +++ b/src/DotEnv.php @@ -94,6 +94,10 @@ class DotEnv // strip ending " and EVERYTHING that follows after that $line = $matches[1]; } + // just be sure it is init before we fill + if (!isset($_ENV[$var])) { + $_ENV[$var] = ''; + } // strip line of slashes $_ENV[$var] .= stripslashes($line); }