8000 Fix: Correctly decode Unicode escape sequences in JsonDecode by Darshan-H-E · Pull Request #560 · nzbgetcom/nzbget · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix: Correctly decode Unicode escape sequences in JsonDecode #560

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

Merged

Conversation

Darshan-H-E
Copy link
Contributor

Description

The JsonDecode function in WebUtil incorrectly handled Unicode escape sequences like \u0026. This could lead to malformed data when decoding JSON, particularly URLs containing ampersands passed via the API.

This commit modifies the JsonDecode logic to correctly parse \uXXXX sequences into their corresponding characters using strtoul.

Lib changes

NA

Testing

Unit tests have been added in JsonDecodeTest to verify the fix and cover various standard and Unicode escape sequence scenarios.

The JsonDecode function in WebUtil incorrectly handled Unicode escape
sequences like \u0026. This could lead to malformed data when decoding
JSON, particularly URLs containing ampersands passed via the API.

This commit modifies the JsonDecode logic to correctly parse \uXXXX
sequences into their corresponding characters using strtoul.

Unit tests have been added in JsonDecodeTest to verify the fix and cover
various standard and Unicode escape sequence scenarios.
Copy link
Collaborator
@dnzbk dnzbk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dnzbk dnzbk linked an issue May 2, 2025 that may be closed by this pull request
1 task
@dnzbk dnzbk merged commit 170b00e into nzbgetcom:develop May 2, 2025
9 checks passed
@dnzbk dnzbk mentioned this pull request May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

\u0026 is replaced by j in URL when adding nzb through API
2 participants
0