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

json_decode strictness regression #5

Closed
zergin opened this issue Aug 23, 2013 · 3 comments
Closed

json_decode strictness regression #5

zergin opened this issue Aug 23, 2013 · 3 comments

Comments

@zergin
Copy link

zergin commented Aug 23, 2013

Hi,

following up on php bug 65499 - there is a regression in some distro PHP packages starting from version php-5.5 related to pecl-json-c.

The regression can be observed running simple test:

Test script:
---------------
<?php
var_dump(
  json_decode("9af5"), 
  json_last_error()
  json_decode("129af5"), 
  json_last_error()
);
?>

Expected result:
----------------
NULL
int(4)
NULL
int(4)

Actual result:
--------------
int(9)
int(0)
int(129)
int(0)
@remicollet
Copy link
Owner

This change is caused by jsonc-c library parser being very less strict than original one.

I'm working on adding more strictness, but this requires some changes in the json-c library.

Probablyalso worth a bug report there.
https://github.com/json-c/json-c

@remicollet
Copy link
Owner

Fixed in r 544d2a8

@zergin
Copy link
Author

zergin commented Aug 27, 2013

Great - thanks for such a quick fix.

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

2 participants