summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-08-04 16:32:36 -0400
committerMichael Foster <savetheinternet@tinyboard.org>2013-08-04 16:32:36 -0400
commitacfda35648b5a3eac5607084b781c0ced8e0bc53 (patch)
tree10a09d61e536b83ecb757866f0febc04abf61fa2 /inc/functions.php
parenta3cf56a7688d9f5063ac06e5bf8afac0a693f2f0 (diff)
gifsicle: redirect stdout to /dev/null but keep stderr going to stdout
Diffstat (limited to 'inc/functions.php')
-rw-r--r--inc/functions.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/inc/functions.php b/inc/functions.php
index 82f047b5..01fdb18e 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -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']) {