diff options
author | Urban Müller | 2023-07-05 14:06:58 +0200 |
---|---|---|
committer | Urban Müller | 2023-07-05 14:06:58 +0200 |
commit | 26cec3ea70f65b655e16a9ba88951a9050b646c2 (patch) | |
tree | 153265ae7bd3ba21248a27537ec61ad73cded2e8 | |
parent | 36ffd806aec597c6e3eff966d47f02cb23f66a7b (diff) | |
download | itools-26cec3ea70f65b655e16a9ba88951a9050b646c2.tar.gz itools-26cec3ea70f65b655e16a9ba88951a9050b646c2.tar.bz2 itools-26cec3ea70f65b655e16a9ba88951a9050b646c2.zip |
mark safe it::shell_command calls
-rw-r--r-- | it.class | 6 | ||||
-rw-r--r-- | it_pipe.class | 2 |
2 files changed, 4 insertions, 4 deletions
@@ -674,12 +674,12 @@ static function filter_keys($array, $keys, $p = array()) * {0} .. {n} quotes and inserts positional arguments * {-opts} array of opts => {value,true,false,null}: it::exec('ls {-opts}', ['-opts' => ["-l" => true]]); * @param $cmd Format string with {keywords} a la ET() - * @param $args varargs, contains key => val arrays for filling in cmd line. val=null expands to nothing + * @param $args varargs, contains key => val arrays or positionals for filling in cmd line. val=null expands to nothing * @return output of command. shell errors not detectable, consider it::system or see /www/server/log/error_log */ static function exec($cmd, ...$args) { - $cmd = it::shell_command($cmd, ...$args); + $cmd = it::shell_command($cmd, ...$args); # NOPHPLINT $before = gettimeofday(true); $result = EDC('noexec') ? "" : (string)shell_exec("set +o posix\n" . $cmd); @@ -697,7 +697,7 @@ static function exec($cmd, ...$args) */ static function system($cmd, ...$args) { - $cmd = it::shell_command($cmd, ...$args); + $cmd = it::shell_command($cmd, ...$args); # NOPHPLINT $before = gettimeofday(true); if (!EDC('noexec')) diff --git a/it_pipe.class b/it_pipe.class index 73ce75a..fd1e7cf 100644 --- a/it_pipe.class +++ b/it_pipe.class @@ -228,7 +228,7 @@ function lines() */ function pipe($cmd, ...$args) { - $cmd = it::shell_command($cmd, ...$args); + $cmd = it::shell_command($cmd, ...$args); # NOPHPLINT $descriptors = array(0 => array("pipe", "r"), 1 => array("pipe", "w")); $process = proc_open($cmd, $descriptors, $pipes); |