8000 [Dotenv] Invinite loop with missing quote · Issue #34642 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Dotenv] Invinite loop with missing quote #34642
Closed
@stollr

Description

@stollr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0