Closed
Description
Symfony version(s) affected: v4.4.0
Description
A missing closing quote in a line leads to an infinite loop telling:
PHP Notice: Uninitialized string offset: 592 in /var/www/ecgpb-memberlist/vendor/symfony/dotenv/Dotenv.php on line 289
PHP Stack trace:
PHP 1. {main}() /var/www/ecgpb-memberlist/test.php:0
PHP 2. Symfony\Component\Dotenv\Dotenv->parse() /var/www/ecgpb-memberlist/test.php:11
PHP 3. Symfony\Component\Dotenv\Dotenv->lexValue() /var/www/ecgpb-memberlist/vendor/symfony/dotenv/Dotenv.php:200
How to reproduce
Try this code to reproduce:
require __DIR__.'/vendor/autoload.php';
$testString = 'FOO="x"
DOO="y
VOO="z"';
$dotenv = new \Symfony\Component\Dotenv\Dotenv();
$dotenv->parse($testString);
In the second line DOO="y
is missing the closing quote at the end. But this shouldn't result in an infinite loop, but in a helpful error message.