From 7e4e7fdb0663b20d2869052ab8389ffa83852e03 Mon Sep 17 00:00:00 2001 From: sebprt Date: Tue, 9 Jan 2024 10:53:29 +0100 Subject: [PATCH] Fixe the composer require command : escape shell arg --- src/PHP/ComposerRequire.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PHP/ComposerRequire.php b/src/PHP/ComposerRequire.php index 5eeaca9..fcf69b8 100644 --- a/src/PHP/ComposerRequire.php +++ b/src/PHP/ComposerRequire.php @@ -20,6 +20,6 @@ public function __toString(): string return (string) new Dockerfile\Run(sprintf(<<<'RUN' set -ex \ && composer require --prefer-dist --no-progress --prefer-stable --sort-packages --optimize-autoloader --with-dependencies %s - RUN, implode(' ', $this->packages))); + RUN, implode(' ', array_map(fn (string $package) => escapeshellarg($package), $this->packages)))); } }