Skip to content

Commit e8c787d

Browse files
authored
🩹 Fix console arguments containing quotes (Fixes #459) (#462)
* 🔥 Remove unused class
1 parent ce2f478 commit e8c787d

File tree

2 files changed

+4
-72
lines changed

2 files changed

+4
-72
lines changed

src/Roots/Acorn/Application/Concerns/Bootable.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ protected function bootWpCli(): void
7979
WP_CLI::add_command('acorn', function ($args, $options) use ($kernel) {
8080
$kernel->commands();
8181

82-
$command = implode(' ', $args);
82+
$escaped = array_map(fn ($arg) => escapeshellarg($arg), $args);
83+
84+
$command = implode(' ', $escaped);
8385

8486
foreach ($options as $key => $value) {
8587
if ($key === 'interaction' && $value === false) {
@@ -91,7 +93,7 @@ protected function bootWpCli(): void
9193
$command .= " --{$key}";
9294

9395
if ($value !== true) {
94-
$command .= "='{$value}'";
96+
$command .= '='.escapeshellarg($value);
9597
}
9698
}
9799

src/Roots/Acorn/Bootstrap/RegisterConsole.php

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)