From a760527e498cdf29281fbae8f519c173fe096c7c Mon Sep 17 00:00:00 2001 From: Buster Silver Date: Sat, 26 Dec 2015 10:29:36 -0600 Subject: [PATCH] Closes #42 -- Check for specific "null" string when doing string replacement. --- app/Console/Commands/PoniverseApiSetup.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Console/Commands/PoniverseApiSetup.php b/app/Console/Commands/PoniverseApiSetup.php index bc6426a4..73879855 100644 --- a/app/Console/Commands/PoniverseApiSetup.php +++ b/app/Console/Commands/PoniverseApiSetup.php @@ -104,6 +104,10 @@ class PoniverseApiSetup extends Command protected function setEnvironmentVariable($key, $oldValue, $newValue) { $path = base_path('.env'); + // Detect the specific "null" value. + if ($oldValue === null) + $oldValue = 'null'; + if (file_exists($path)) { file_put_contents($path, str_replace( "$key=" . $oldValue, "$key=" . $newValue, file_get_contents($path)