Skip to content

[2.6.0] Single quotes parsed literally #337

Closed

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

Activity

  1. changed the title [-]Single quotes parsed literally[/-] [+][2.6.0] Single quotes parsed literally[/+] on Jan 29, 2019
  2. GrahamCampbell commented on Jan 29, 2019

    @GrahamCampbell
    Collaborator

    Please let me know if #338 fixes your issue. :)

  3. GrahamCampbell commented on Jan 29, 2019

    @GrahamCampbell
    Collaborator

    I've released v2.6.1 with the parser fixes.

  4. mbrodala commented on Jan 29, 2019

    @mbrodala
    Author

    I've just checked and the latest version restores the previous behavior, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions