Repository navigation
variable with quote length more than 2730, getenv() return null #324
Description
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
GrahamCampbell commentedon Jan 28, 2019
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.
GrahamCampbell commentedon Jan 28, 2019
@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.
GrahamCampbell commentedon Jan 28, 2019
Examples of the other failing case I had in mind:
kaelli1234 commentedon Jan 29, 2019
@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.