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

Skip to content

[JsonPath] the JsonCrawler does not handle unicode escape sequences in JsonPath strings #60665

Closed
@stof

Description

@stof

Symfony version(s) affected

7.3.0

Description

JsonCrawler currently uses stripcslashes to resolve the escaping of keys in strings to get the actual string content: https://github.com/symfony/symfony/blob/v7.3.0/src/Symfony/Component/JsonPath/JsonCrawler.php#L233

However, the RFC9535 defines escape sequences for Unicode characters, inherited from the JSON syntax: https://www.rfc-editor.org/rfc/rfc9535#name-semantics-3

How to reproduce

Write a JsonPath expression using unicode escape sequences.

Possible Solution

For double-quoted strings, maybe relying on json_decode could work. But as we need to support single-quoted strings that are not supported in JSON, this might not be worth it.

Additional Context

No response

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