From 24f7e7d4ecb3cd4ffb1dd6109392deaac131beed Mon Sep 17 00:00:00 2001 From: Carlos Rodrigues Date: Fri, 7 Apr 2017 15:10:50 -0400 Subject: [PATCH] Set json_decode() JSON_BIGINT_AS_STRING flag to avoid int32 wrapping/saturation on large resource identifiers --- shopify.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shopify.php b/shopify.php index 76ac4d4..df676cb 100644 --- a/shopify.php +++ b/shopify.php @@ -118,7 +118,7 @@ class ApiException extends Exception function __construct($message, $code, $request, $response=array(), Exception $previous=null) { $response_body_json = isset($response['body']) ? $response['body'] : ''; - $response = json_decode($response_body_json, true); + $response = json_decode($response_body_json, true, 512, JSON_BIGINT_AS_STRING); $response_error = isset($response['errors']) ? ' '.var_export($response['errors'], true) : ''; $this->message = $message.$response_error; parent::__construct($this->message, $code, $request, $response, $previous);