Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ExpressionLanguage\TokenStream make notice instead of exception #25214

Closed
@JetJsF

Description

@JetJsF
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 2.8

Incorrect iteration over tokens lead to error, code example:
$language = new ExpressionLanguage();
$parsedExpression = $language->parse('node.', ['node']);

Expected result: SyntaxError('Unexpected end of expression around position 5')
Actual result: Notice: Undefined offset: 3

Error can be found at Symfony\Component\ExpressionLanguage\TokenStream:58
Lack of checking the key exist lead to this error

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