Skip to content

CssSelector does not properly unescape values before generating XPath #46682

Closed
@stof

Description

@stof

Symfony version(s) affected

all

Description

The tokenizer properly recognizes escape sequences as being part of a CSS identifier. But it keeps the escape sequence in the token value, which is then kept in the XPath.

How to reproduce

$converter = new \Symfony\Component\CssSelector\CssSelectorConverter();
dump($converter->toXPath('#foo\.bar'));

Possible Solution

To me, the unescaping should probably be done at the tokenizer level

Additional Context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions