mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-02-21 13:09:41 +01:00
Revert 9920a51ff5a5c6914f5bc72ce60c22245d5f1352
This commit is contained in:
parent
0e63c5041a
commit
2a40d82c00
@ -2363,21 +2363,10 @@ function DNS($host) {
|
||||
function shell_exec_error($command, $suppress_stdout = false) {
|
||||
global $config, $debug;
|
||||
|
||||
if( $config['debug'] ) {
|
||||
$which = microtime(true);
|
||||
}
|
||||
|
||||
// Determine if $command is a valid command. If we don't, the following is considered valid output.
|
||||
// '$command' is not recognized as an internal or external command, operable program or batch file.
|
||||
if( empty( shell_exec("which $command") ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if( $config['debug'] ) {
|
||||
$start = microtime(true);
|
||||
}
|
||||
|
||||
|
||||
$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);
|
||||
@ -2388,7 +2377,7 @@ function shell_exec_error($command, $suppress_stdout = false) {
|
||||
|
||||
$debug['exec'][] = array(
|
||||
'command' => $command,
|
||||
'time' => '~' . round($time * 1000, 2) . 'ms + ~' . round($time_which * 1000, 2) . 'ms',
|
||||
'time' => '~' . round($time * 1000, 2) . 'ms',
|
||||
'response' => $return ? $return : null
|
||||
);
|
||||
$debug['time']['exec'] += $time;
|
||||
|
Loading…
x
Reference in New Issue
Block a user