Skip to content

JSON ERROR: The decoded property name is invalid #256

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

Open
robmyers82 opened this issue Jan 13, 2020 · 1 comment
Open

JSON ERROR: The decoded property name is invalid #256

robmyers82 opened this issue Jan 13, 2020 · 1 comment

Comments

@robmyers82
Copy link

We are receiving a 'JSON ERROR: The decoded property name is invalid' error message when trying to retrieve orders. We discovered why this is caused: there is a plugin installed in the store's WC that is adding the Unicode NULL character (\u0000) to a metadata property name. This issue can be resolved by stripping out any instances of the null character in the response body before decoding JSON at https://github.com/woocommerce/wc-api-php/blob/master/src/WooCommerce/HttpClient/HttpClient.php#L372:

$body = str_replace('\u0000', '', $body);

@robmyers82
Copy link
Author

Please note, I submitted a Pull Request to resolve this issue at #257. However, it looks like it may have some issues with validation that appear to be resolved with another Pull Request.

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