From: Marcin Haba Date: Thu, 9 Mar 2023 09:15:37 +0000 (+0100) Subject: baculum: Add displaying bconsole command output if command is multiline X-Git-Tag: Release-13.0.3~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=645510a99abf4ea0ac1f44e544170876125d825b;p=thirdparty%2Fbacula.git baculum: Add displaying bconsole command output if command is multiline --- diff --git a/gui/baculum/protected/API/Modules/Bconsole.php b/gui/baculum/protected/API/Modules/Bconsole.php index fa3f525b4..b067c59dc 100644 --- a/gui/baculum/protected/API/Modules/Bconsole.php +++ b/gui/baculum/protected/API/Modules/Bconsole.php @@ -171,6 +171,11 @@ class Bconsole extends APIModule { private function prepareResult(array $output, $exitcode, $bconsole_command) { array_pop($output); // deleted 'quit' bconsole command $out = $output; + if (strpos($bconsole_command, PHP_EOL) !== false) { + // for multiline commands take the first command line + $bc = explode(PHP_EOL, $bconsole_command); + $bconsole_command = $bc[0]; + } for($i = 0; $i < count($out); $i++) { if(strstr($out[$i], $bconsole_command) == false) { unset($output[$i]);