mirror of
https://github.com/processwire/processwire.git
synced 2025-08-15 11:14:12 +02:00
Fix issue processwire/processwire-issues#919 (WireCache/JSON)
This commit is contained in:
@@ -449,8 +449,8 @@ class WireCache extends Wire {
|
|||||||
$data = json_encode($data);
|
$data = json_encode($data);
|
||||||
if($data === false) throw new WireException("Unable to encode array data for cache: $name");
|
if($data === false) throw new WireException("Unable to encode array data for cache: $name");
|
||||||
} else if(is_string($data) && $this->looksLikeJSON($data)) {
|
} else if(is_string($data) && $this->looksLikeJSON($data)) {
|
||||||
// ensure potentailly already encoded JSON text remains as text when cache is awakened
|
// ensure potentially already encoded JSON text remains as text when cache is awakened
|
||||||
$data = array('WireCache' => $data);
|
$data = json_encode(array('WireCache' => $data));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_null($data)) $data = '';
|
if(is_null($data)) $data = '';
|
||||||
|
Reference in New Issue
Block a user