update: inline args.

This commit is contained in:
Darshan
2026-01-26 17:35:13 +05:30
parent 5690eb1dc5
commit fc2ee0c32a
3 changed files with 4 additions and 8 deletions
@@ -222,8 +222,7 @@ class HttpHandler
if (function_exists('posix_getpid')) {
$pid = posix_getpid();
if ($pid) {
$delay = 5;
$command = 'sh -c ' . escapeshellarg("sleep {$delay}; kill {$pid} >/dev/null 2>&1");
$command = 'sh -c ' . escapeshellarg("sleep 5; kill $pid >/dev/null 2>&1");
@exec($command . ' >/dev/null 2>&1 &');
}
}
+2 -4
View File
@@ -228,9 +228,8 @@ class Server
private function dockerImageExists(string $image): bool
{
$name = escapeshellarg($image);
$result = 1;
exec("docker image inspect $name >/dev/null 2>&1", $output, $result);
exec("docker image inspect " . escapeshellarg($image) . " >/dev/null 2>&1", $output, $result);
return $result === 0;
}
@@ -304,8 +303,7 @@ class Server
$args[] = '--entrypoint=' . $entrypoint;
$args[] = $image;
$escaped = array_map(escapeshellarg(...), $args);
$command = implode(' ', $escaped);
$command = implode(' ', array_map(escapeshellarg(...), $args));
passthru($command, $status);
exit($status);
}
+1 -2
View File
@@ -782,8 +782,7 @@ class Install extends Action
$command[] = '-d';
$command[] = '--remove-orphans';
$command[] = '--renew-anon-volumes';
$escaped = array_map(escapeshellarg(...), $command);
$commandLine = $env . implode(' ', $escaped) . ' 2>&1';
$commandLine = $env . implode(' ', array_map(escapeshellarg(...), $command)) . ' 2>&1';
\exec($commandLine, $output, $exit);
if ($exit !== 0) {