]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Add displaying bconsole command output if command is multiline
authorMarcin Haba <marcin.haba@bacula.pl>
Thu, 9 Mar 2023 09:15:37 +0000 (10:15 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sat, 11 Mar 2023 21:32:26 +0000 (22:32 +0100)
gui/baculum/protected/API/Modules/Bconsole.php

index fa3f525b48d8456e8468e3fd7016c73a86704893..b067c59dce514dd93c49cd15f04fc516fdd2048a 100644 (file)
@@ -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]);