From f8ab6c1d50eaca43cd64d93e5b186791b9cd80b7 Mon Sep 17 00:00:00 2001 From: Jaime Date: Mon, 11 May 2020 12:41:46 -0700 Subject: [PATCH] Allows JSON unserializing to be associative or object --- lib/internal/Magento/Framework/Serialize/Serializer/Json.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Serialize/Serializer/Json.php b/lib/internal/Magento/Framework/Serialize/Serializer/Json.php index 7ce9756ff243d..236b852c76232 100644 --- a/lib/internal/Magento/Framework/Serialize/Serializer/Json.php +++ b/lib/internal/Magento/Framework/Serialize/Serializer/Json.php @@ -32,9 +32,9 @@ public function serialize($data) * @inheritDoc * @since 100.2.0 */ - public function unserialize($string) + public function unserialize($string, $assoc = true) { - $result = json_decode($string, true); + $result = json_decode($string, $assoc); if (json_last_error() !== JSON_ERROR_NONE) { throw new \InvalidArgumentException("Unable to unserialize value. Error: " . json_last_error_msg()); }