composer: command args as list rather than string (#10525)

* composer: command args as list rather than string

* add changelog frag
This commit is contained in:
Alexei Znamensky 2025-08-05 06:00:56 +12:00 committed by GitHub
commit 5bdd82fbf5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- composer - using safer mechanism to run external command (https://github.com/ansible-collections/community.general/pull/10525).

View file

@ -188,7 +188,7 @@ def composer_command(module, command, arguments="", options=None):
else:
composer_path = module.params['composer_executable']
cmd = "%s %s %s %s %s %s" % (php_path, composer_path, "global" if global_command else "", command, " ".join(options), arguments)
cmd = [php_path, composer_path, "global" if global_command else "", command] + options + [arguments]
return module.run_command(cmd)