Closed Bilge closed 2 years ago
You should be able to just enter Foo Bar
without the \
. Have you tried that?
@brandonkelly You definitely cannot because the Postgres driver will not receive the part after the space as the database name otherwise.
Testing database credentials ... failed: SQLSTATE[08006] [7] missing "=" after "Bar" in connection info string
Gotcha, thanks. Able to reproduce and fixed for the next release.
To get the fix early, change your craftcms/cms
requirement in composer.json to "dev-develop as 3.7.26"
and run composer update
.
Craft 3.7.27 is out now with that fix.
Just encountered this problem again now with Craft 3.8.16 with a smtp password in my .env file that contains \
Failed at ["\1a:~123@tQ+Y;9S<#CB"]
And just realised that it needs to be escaped. So just escaping that backslash did the trick.
@peirix Glad you got it sorted!
Description
./craft setup
produces an invalid dotenv file if the expression contains a backslash.So far as I can tell, the setup enters what I would consider to be the "correct" entry in the dotenv file, that is:
DB_DATABASE="Foo\ Bar"
. At least, this would be correct forSymfony\Dotenv
, but it seems this project is using a differentDotenv\Dotenv
which fails to parse this.Since this library appears to be attempting its own backslash unescaping, for reasons that remain unclear, perhaps craft should actually write
DB_DATABASE="Foo\\ Bar"
.Steps to reproduce
./craft setup
Foo\ Bar
as the database name.Additional info