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

Fail API gracefully on json_encode errors #248

Open
sergeychernyshev opened this issue Aug 22, 2016 · 0 comments
Open

Fail API gracefully on json_encode errors #248

sergeychernyshev opened this issue Aug 22, 2016 · 0 comments

Comments

@sergeychernyshev
Copy link
Member

If json_encode fails when API endpoint is called (e.g. UTF8 problem), fail gracefully using json_last_error() and json_last_error_msg() - check if they are available in PHP version used.

To reproduce, pass a parameter that decodes to invalid UTF8 string.

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

No branches or pull requests

1 participant