Refactor environment variable saving logic in ApplicationDeploymentJob.php and escapeEnvVariables function in docker.php

This commit is contained in:
Andras Bacsai
2024-04-12 09:26:04 +02:00
parent a8db40e99a
commit 2382a10bba
2 changed files with 11 additions and 2 deletions

View File

@@ -582,7 +582,7 @@ function validateComposeFile(string $compose, int $server_id): string|Throwable
function escapeEnvVariables($value)
{
$search = array("\\", "\r", "\t", "\x0", '"', "'", "$");
$replace = array("\\\\", "\\r", "\\t", "\\0", '\"', "\'", "$$");
$search = array("\\", "\r", "\t", "\x0", '"', "'");
$replace = array("\\\\", "\\r", "\\t", "\\0", '\"', "\'");
return str_replace($search, $replace, $value);
}