Skip to content
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

Correctly handle explicitly providing JSON_THROW_ON_ERROR in JsonResponse #169

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

TimWolla
Copy link
Contributor

@TimWolla TimWolla commented Aug 1, 2023

Q A
Documentation no
Bugfix yes
BC Break maybe
New Feature no
RFC no
QA no

Description

If the JSON_THROW_ON_ERROR flag is explicitly given, jsonEncode() violates its contract to throw InvalidArgumentException if it is unable to encode the input as JSON.

…onse

If the `JSON_THROW_ON_ERROR` flag is explicitly given, `jsonEncode()` violates
its contract to throw `InvalidArgumentException` if it is unable to encode the
input as JSON.

Signed-off-by: Tim Düsterhus <duesterhus@woltlab.com>
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

Good improvement, thanks @TimWolla!

@Ocramius Ocramius self-assigned this Aug 1, 2023
@Ocramius Ocramius added this to the 3.1.0 milestone Aug 1, 2023
@Ocramius Ocramius changed the title Correctly handle explicitly providing JSON_THROW_ON_ERROR in JsonResponse Correctly handle explicitly providing JSON_THROW_ON_ERROR in JsonResponse Aug 1, 2023
@Ocramius Ocramius merged commit 283cdc5 into laminas:3.1.x Aug 1, 2023
11 checks passed
@TimWolla TimWolla deleted the json-response-error branch August 1, 2023 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants