Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stof opened this issue Jun 3, 2025 · 1 comment · Fixed by #60681
Closed

Comments

@stof
Copy link
Member

stof commented Jun 3, 2025

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

@stof
Copy link
Member Author

stof commented Jun 3, 2025

/cc @alexandre-daubois

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants