Skip to content

[2.6.0] Single quotes parsed literally #337

Closed
@mbrodala

Description

@mbrodala

Since version 2.6.0 single quotes are apparently parsed literally which leads to various issues:

foo='value with spaces' is now 'value with spaces' (was value with spaces) and is thus unquoted (as in: not surrounded by double quotes) leading to an error:

PHP Fatal error: Uncaught Dotenv\Exception\InvalidFileException: Dotenv values containing spaces must be surrounded by quotes. in /.../vendor/vlucas/phpdotenv/src/Parser.php:7

Due to this, the $ character cannot be escaped properly anymore:

  • foo='$bar' is now '$bar' (was $bar)
  • foo="\$bar" is \$bar
  • foo="$bar" is $bar but this will lead to issues when .env is loaded e.g. in Bash which then tries to load a non-existing variable called bar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions