diff --git a/src/Http/Controllers/InstallController.php b/src/Http/Controllers/InstallController.php index ab9bfd3..2275ee6 100644 --- a/src/Http/Controllers/InstallController.php +++ b/src/Http/Controllers/InstallController.php @@ -170,7 +170,7 @@ public function saveDatabaseSettings() $dotEnv = Dotenv::create([base_path()]); foreach ($dotEnv->load() as $envVar => $envValue) { if (key_exists($envVar, $updateEnv)) { - $envFileContents = preg_replace('#' . $envVar . '.*=.*' . $envValue . '.*#', $envVar . '=' . $updateEnv[$envVar], $envFileContents); + $envFileContents = preg_replace('#^\W*' . $envVar . '\W*=\W*' . $envValue . '.\W*$#', $envVar . '=' . $updateEnv[$envVar], $envFileContents); } }