Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Dotenv] Invinite loop with missing quote #34642

Copy link
Copy link
Closed
@stollr

Description

@stollr
Issue body actions

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.