cli
cli copied to clipboard
statamic new <site> incorrectly saves the superuser password on Windows
Bug description
The statamic new <site name> command may not save the superuser password correctly, resulting in the impossibility to connect with the password typed during the process, which makes it confusing.
How to reproduce
- Run
statamic new <site name>with a site name of your choosing. Make it so a superuser will be created in the process. - When asked for the super user password, type anything that contains a
$, for instance123$456789. - Open the site and try to connect to the control panel. Using
123$456789is not the correct password but123is. Apparently,$and everything to its right is ignored.
Logs
No response
Environment
Environment
Application Name: Statamic
Laravel Version: 11.26.0
PHP Version: 8.3.12
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: Test.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file
Statamic
Addons: 0
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.29.0 Solo
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
Which operating system are you using?
I am on Windows 11.
Works fine on Mac, at least.
It probably has something to do with the CLI's "make user" code.
Since Windows doesn't have TTY (which means we can't defer to Core's make:user command), the user gets created manually.
https://github.com/statamic/cli/blob/304a0b265dc7f569ddb50e01bd13d54d96bd04e2/src/NewCommand.php#L669-L702
escapeshellarg($password) might be causing it.