From a7d0ec1c91829b23aef1075cb2b0121626595e74 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Tue, 12 Jan 2021 07:02:42 -0500 Subject: [PATCH] Fix issue processwire/processwire-issues#919 (WireCache/JSON) --- wire/core/WireCache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wire/core/WireCache.php b/wire/core/WireCache.php index d4b1b4be..8e7edf0c 100644 --- a/wire/core/WireCache.php +++ b/wire/core/WireCache.php @@ -449,8 +449,8 @@ class WireCache extends Wire { $data = json_encode($data); if($data === false) throw new WireException("Unable to encode array data for cache: $name"); } else if(is_string($data) && $this->looksLikeJSON($data)) { - // ensure potentailly already encoded JSON text remains as text when cache is awakened - $data = array('WireCache' => $data); + // ensure potentially already encoded JSON text remains as text when cache is awakened + $data = json_encode(array('WireCache' => $data)); } if(is_null($data)) $data = '';