Skip to content

Commit

Permalink
Replace serialize/unserialize with json_encode/json_decode. The remai…
Browse files Browse the repository at this point in the history
…ning calls are the same as in 1.9.3.10 core. Closes #32
  • Loading branch information
jonathanselander committed Oct 23, 2018
1 parent 926007a commit c2d4721
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/code/Cache/Redis/Backend.php
Expand Up @@ -228,7 +228,7 @@ protected function _saveMetadata($client, $id, $metadata)
{
$metadataKey = $this->_metadataPrefix . $id;
$metadata['mtime'] = time();
$client->setex($metadataKey, $metadata['expire'], gzcompress(serialize($metadata), 6));
$client->setex($metadataKey, $metadata['expire'], gzcompress(json_encode($metadata), 6));
}

/**
Expand Down Expand Up @@ -324,7 +324,7 @@ public function getMetadatas($id)
return false;
}
}
return unserialize($result);
return json_decode($result);
}

/**
Expand Down Expand Up @@ -456,7 +456,7 @@ public function test($id)
if ($metadata === false) {
return false;
}
$metadata = unserialize($metadata);
$metadata = json_decode($metadata);
if (!is_array($metadata) || empty($metadata['mtime'])) {
return false;
}
Expand Down

0 comments on commit c2d4721

Please sign in to comment.