diff --git a/etc/config/command.php b/etc/config/command.php index 7b80d7284..047af324a 100644 --- a/etc/config/command.php +++ b/etc/config/command.php @@ -11,9 +11,9 @@ $magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER); $tokenModel = $magentoObjectManager->get(\Magento\Integration\Model\Oauth\Token::class); - $tokenPassedIn = urldecode($_POST['token'] ?? ""); - $command = urldecode($_POST['command'] ?? ""); - $arguments = urldecode($_POST['arguments'] ?? ""); + $tokenPassedIn = urldecode($_POST['token']); + $command = urldecode($_POST['command']); + $arguments = urldecode($_POST['arguments']); // Token returned will be null if the token we passed in is invalid $tokenFromMagento = $tokenModel->loadByToken($tokenPassedIn)->getToken(); @@ -22,12 +22,7 @@ $magentoBinary = $php . ' -f ../../../../bin/magento'; $valid = validateCommand($magentoBinary, $command); if ($valid) { - // Turn string into array for symfony escaping - $commandParts = array_filter(explode(" ", $command), 'strlen'); - $argumentParts = array_filter(explode(" ", $arguments), 'strlen'); - $magentoBinaryParts = array_filter(explode(" ", $magentoBinary), 'strlen'); - $commandArray = array_merge($magentoBinaryParts, $commandParts, $argumentParts); - $process = new Symfony\Component\Process\Process($commandArray); + $process = new Symfony\Component\Process\Process($magentoBinary . " $command" . " $arguments"); $process->setIdleTimeout(60); $process->setTimeout(0); $idleTimeout = false;