Skip to content

Commit

Permalink
Fixe the composer require command : escape shell arg
Browse files Browse the repository at this point in the history
  • Loading branch information
sebprt committed Jan 9, 2024
1 parent 0e25080 commit 7e4e7fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PHP/ComposerRequire.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
}
}

0 comments on commit 7e4e7fd

Please sign in to comment.