diff --git a/plugins/dynamix.docker.manager/include/Helpers.php b/plugins/dynamix.docker.manager/include/Helpers.php index 98a6bde20..afcdb3798 100644 --- a/plugins/dynamix.docker.manager/include/Helpers.php +++ b/plugins/dynamix.docker.manager/include/Helpers.php @@ -413,9 +413,9 @@ function pullImage($name, $image) { } function execCommand($command) { - if ( dockerRunSecurity($command) ) { - $command = "logger 'docker command execution halted due to security violation (Bash command execution or redirection)'"; - } + if ( dockerRunSecurity($command) ) { + $command = "logger 'docker command execution halted due to security violation (Bash command execution or redirection)'"; + } // $command should have all its args already properly run through 'escapeshellarg' $descriptorspec = [ 0 => ['pipe', 'r'], // stdin is a pipe that the child will read from @@ -443,17 +443,17 @@ function execCommand($command) { } function dockerRunSecurity($command) { - $testCommand = htmlspecialchars_decode($command); - $cmdSplit = explode("'",$testCommand); - for ($i=0; $i","&&"] as $invalidChars ) { - if ( strpos($tstCommand,$invalidChars) ) { - return true; - } - } - return false; + $testCommand = htmlspecialchars_decode($command); + $cmdSplit = explode("'",$testCommand); + for ($i=0; $i","&&"] as $invalidChars ) { + if ( strpos($tstCommand,$invalidChars) ) { + return true; + } + } + return false; } function getXmlVal($xml, $element, $attr=null, $pos=0) {