Skip to content

variable with quote length more than 2730, getenv() return null #324

Closed

Description

@kaelli1234

v2.4.0
I have a long json string then I put it in the.env file. But when I get it by the getenv() or $_ENV, it return empty.
So I test then found:
when the variable length more chan 2730,
Loader.php -> sanitiseVariableValue() -> preg_replace() return null.
my test .env:
test='111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'

Activity

  1. GrahamCampbell commented on Jan 28, 2019

    @GrahamCampbell
    Collaborator

    Thanks for the report. I believe this was actually fixed in the 2.5.x series by #275. As such, I can't replicate this issue in the current latest 2.x or 3.x releases.

    Please see the test results on each version:


    That said, I am aware that there are still cases where the 2.x series will silently fail when parsing fails, as you were seeing in 2.4.x. I've made an attempt to backport the new parser from 3.x, and modified it as to behave as close to 2.5.x as possible: #325.

  2. GrahamCampbell commented on Jan 28, 2019

    @GrahamCampbell
    Collaborator

    @kaelli1234 Please confirm that the 2.5.2 release behaves correctly, and also that my implementation at #325 behaves correctly. It will become part of the 2.6.0 release, if we're sure it's correct.

  3. GrahamCampbell commented on Jan 28, 2019

    @GrahamCampbell
    Collaborator

    Examples of the other failing case I had in mind:

  4. kaelli1234 commented on Jan 29, 2019

    @kaelli1234
    Author

    @GrahamCampbell
    Thank you for your reply.
    I believe the new version already fix it. But I am afraid I can't upgrade to the new version right now.
    I avoided this problem by removing the begin and end quotes.

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