From 8bf3d71277e1ac51ca7c8e89182c6ffda2a26c26 Mon Sep 17 00:00:00 2001 From: Robert Myers Date: Mon, 13 Jan 2020 10:48:31 -0400 Subject: [PATCH] Stripping Unicode null character from result so it does not affect property names --- src/WooCommerce/HttpClient/HttpClient.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/WooCommerce/HttpClient/HttpClient.php b/src/WooCommerce/HttpClient/HttpClient.php index c1f90ad..7589be9 100644 --- a/src/WooCommerce/HttpClient/HttpClient.php +++ b/src/WooCommerce/HttpClient/HttpClient.php @@ -370,6 +370,9 @@ protected function processResponse() $body = substr($body, 3); } + // strip out instances of the Unicode NULL character (\u0000) from property names + $body = str_replace('\u0000', '', $body); + $parsedResponse = \json_decode($body); // Test if return a valid JSON.