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

[ExpressionLanguage] Trailing spaces in expressions lead to 'Uninitialized string offset: X' warnings #9606

Copy link
Copy link
Closed
@rolebi

Description

@rolebi
Issue body actions

Using Symfony\Component\ExpressionLanguage::tokenize() with ' ' (only spaces) or any expression with trailing spaces like '1 + 1 ' will produce an Uninitialized string offset: X php warning due to the way spaces are ignored:

// Symfony\Component\ExpressionLanguage::tokenize() lines 39 to 41

while (' ' == $expression[$cursor]) {
    ++$cursor;
}

If EOF_TYPE Token position is not a problem, a rtrim on passed expression will do the job.

Metadata

Metadata

Assignees

No one assigned

    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.