Fix .env Files for Isolated Users (#496)

This commit is contained in:
Richard Anderson
2025-02-22 08:23:03 +00:00
committed by GitHub
parent 2356e44f5b
commit 1223ea1499
5 changed files with 39 additions and 8 deletions

View File

@ -112,7 +112,9 @@ public function exec(string $command, string $log = '', ?int $siteId = null, ?bo
try {
if ($this->asUser) {
$command = 'sudo su - '.$this->asUser.' -c '.'"'.addslashes($command).'"';
$command = addslashes($command);
$command = str_replace('\\\'', '\'', $command);
$command = 'sudo su - '.$this->asUser.' -c '.'"'.trim($command).'"';
}
$this->connection->setTimeout(0);