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

Invalid UTF-16 breaks the parser #52

Open
wfjsw opened this issue Jan 22, 2020 · 1 comment
Open

Invalid UTF-16 breaks the parser #52

wfjsw opened this issue Jan 22, 2020 · 1 comment

Comments

@wfjsw
Copy link

wfjsw commented Jan 22, 2020

It is actually a PHP issue, but I have seen random characters in CharacterInfo.description broke the json_decode parser without any exception thrown, thus is difficult to debug.

Solution part 1:

https://github.com/eveseat/eseye/blob/master/src/Containers/EsiResponse.php#L104
Add JSON_THROW_ON_ERROR flag to json_decode to make it easier to debug such error

Solution part 2:

Add a sanitizer as described in https://stackoverflow.com/questions/58674104/php-json-decode-does-not-work-with-single-unpaired-surrogate-caused-by-node-12-w

Not a clean way, though.

P.S. an example of such error: https://telemetry.eve.ac/share/issue/09f1abc0a4fb4bb09ee1f1f42b4474cb/

@wfjsw
Copy link
Author

wfjsw commented Jan 23, 2020

Note: we should consider these plain-text-response request when applying JSON_THROW_ON_ERROR, for example EsiStatus.

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

No branches or pull requests

1 participant