phpdotenv icon indicating copy to clipboard operation
phpdotenv copied to clipboard

Equals Symbol in last line of multiline variable causes issues.

Open f3cp opened this issue 3 years ago • 2 comments

It looks like the logic for multiline support does not allow for equals signs on the final line.

e.g. This will not load the variable as expected.

BASE64_ENCODED_MULTILINE="qS1zCzMVVUJWQShokv6YVYi+ruKSC/bHV7GmEiyVkLaBWJHNVHCHsgTksEBsy8wJ uwycAvR07ZyOJJed4XTRMKnKp1/v+6UATpWzkIjZXytK+pD+XlZimUHTx3uiDcmU jhQX1wWSxHDqrSWxeIJiTD+BuUyId8FzmXQ3TcBydJ474tmOU2F492ubk3LAiZ18 mhiRGoshXAOSbS/P3+RZi4bDeNE/No4="

While it obviously isn't a case that occurs frequently I came across this when needing to load a certificate without the header/footer e.g. -----END CERTIFICATE----- but still requiring the multiline support. Equals signs are commonly found at the end of certificates and other base64 encoded strings, so it seems like a case worth covering if possible.

f3cp avatar Aug 09 '22 07:08 f3cp

Thanks for getting in touch. What version of the library are you using, please?

GrahamCampbell avatar Aug 09 '22 09:08 GrahamCampbell

Thanks @GrahamCampbell for taking a look - I am using v5.4.1

f3cp avatar Aug 09 '22 13:08 f3cp

Fixed in v4.3.0 and v5.5.0.

GrahamCampbell avatar Oct 16 '22 01:10 GrahamCampbell