sanitizing env value before storing into the .env file

This commit is contained in:
Čarodej
2022-05-09 08:23:38 +02:00
parent 4e2ac2b890
commit 0b2d05a899
3 changed files with 4 additions and 4 deletions

View File

@@ -226,9 +226,9 @@ if (! function_exists('setEnvironmentValue')) {
if ($keyPosition) {
$endOfLinePosition = strpos($str, "\n", $keyPosition);
$oldLine = substr($str, $keyPosition, $endOfLinePosition - $keyPosition);
$str = str_replace($oldLine, "{$envKey}={$envValue}", $str);
$str = str_replace($oldLine, "{$envKey}=\"{$envValue}\"", $str);
} else {
$str .= "\n$envKey=$envValue";
$str .= "\n$envKey=\"$envValue\"";
}
}
}