From c72722ed05926cc3283ef265b3946ad4246616c0 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 3 Sep 2021 22:30:05 +1000 Subject: [PATCH] Wrap all env vars in double quotes --- app/Utils/Traits/AppSetup.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Utils/Traits/AppSetup.php b/app/Utils/Traits/AppSetup.php index 90015496f24d..7ede73b72abe 100644 --- a/app/Utils/Traits/AppSetup.php +++ b/app/Utils/Traits/AppSetup.php @@ -136,11 +136,9 @@ trait AppSetup if (is_null($position)) { $words_count > 1 ? $env[] = "{$property}=" . '"' . $value . '"' . "\n" : $env[] = "{$property}=" . $value . "\n"; - } elseif ($words_count > 1) { - $env[$position] = "{$property}=" . '"' . $value . '"' . "\n"; // If value of variable is more than one word, surround with quotes. } else { - $env[$position] = "{$property}=" . $value . "\n"; // Just a normal variable update, with pre-existing keys. - } + $env[$position] = "{$property}=" . '"' . $value . '"' . "\n"; // If value of variable is more than one word, surround with quotes. + } try { file_put_contents(base_path('.env'), $env);