forked from leftypol/leftypol
gifsicle: redirect stdout to /dev/null but keep stderr going to stdout
This commit is contained in:
parent
a3cf56a768
commit
acfda35648
2 changed files with 5 additions and 4 deletions
|
@ -1939,13 +1939,14 @@ function DNS($host) {
|
|||
return $ip_addr;
|
||||
}
|
||||
|
||||
function shell_exec_error($command) {
|
||||
function shell_exec_error($command, $suppress_stdout = false) {
|
||||
global $config, $debug;
|
||||
|
||||
if ($config['debug'])
|
||||
$start = microtime(true);
|
||||
|
||||
$return = trim(shell_exec('PATH="' . escapeshellcmd($config['shell_path']) . ':$PATH";' . $command . ' 2>&1 && echo "TB_SUCCESS"'));
|
||||
$return = trim(shell_exec('PATH="' . escapeshellcmd($config['shell_path']) . ':$PATH";' .
|
||||
$command . ' 2>&1 ' . ($suppress_stdout ? '> /dev/null ' : '') . '&& echo "TB_SUCCESS"'));
|
||||
$return = preg_replace('/TB_SUCCESS$/', '', $return);
|
||||
|
||||
if ($config['debug']) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue