Skip to content

Commit

Permalink
MQE-1060: Allow magentoCLI Action To Run Without Manipulating Command
Browse files Browse the repository at this point in the history
That Is Sent To CLI

- Adding arguments check to command
  • Loading branch information
aljcalandra committed Jun 21, 2018
1 parent d900236 commit 3ecc5a8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dev/tests/acceptance/utils/command.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@

if (isset($_POST['command'])) {
$command = urldecode($_POST['command']);
if (array_key_exists("arguments", $_POST)) {
$arguments = urldecode($_POST['arguments']);
} else {
$arguments = null;
}
$php = PHP_BINARY ?: (PHP_BINDIR ? PHP_BINDIR . '/php' : 'php');
$valid = validateCommand($command);
if ($valid) {
exec(escapeCommand($php . ' -f ../../../../bin/magento ' . $command) . " 2>&1", $output, $exitCode);
exec(escapeCommand($php . ' -f ../../../../bin/magento ' . $command) . " $arguments" . " 2>&1", $output, $exitCode);
if ($exitCode == 0) {
http_response_code(202);
} else {
Expand Down

0 comments on commit 3ecc5a8

Please sign in to comment.