fix(docker): centralize command escaping in executeInDocker helper (#8615)

This commit is contained in:
Andras Bacsai authored and GitHub committed 2026-02-25 11:51:23 +01:00
commit 57848c25e9
3 files changed
+61 -12

No files matched your search

+3 -2
View File
@@ -139,8 +139,9 @@ function checkMinimumDockerEngineVersion($dockerVersion)
}
function executeInDocker(string $containerId, string $command)
{
return "docker exec {$containerId} bash -c '{$command}'";
// return "docker exec {$this->deployment_uuid} bash -c '{$command} |& tee -a /proc/1/fd/1; [ \$PIPESTATUS -eq 0 ] || exit \$PIPESTATUS'";
$escapedCommand = str_replace("'", "'\\''", $command);
return "docker exec {$containerId} bash -c '{$escapedCommand}'";
}
function getContainerStatus(Server $server, string $container_id, bool $all_data = false, bool $throwError = false)