Commit 58f1f75e authored by webchick's avatar webchick

#718636 by mfb: Fixed Cache returns serialized data only in certain conditions.

parent 3ae281d0
......@@ -387,13 +387,6 @@ protected function prepareItem($cache) {
if (!isset($cache->data)) {
return FALSE;
}
// If the data is permanent or we are not enforcing a minimum cache lifetime
// always return the cached data.
if ($cache->expire == CACHE_PERMANENT || !variable_get('cache_lifetime', 0)) {
if ($cache->serialized) {
$cache->data = unserialize($cache->data);
}
}
// If enforcing a minimum cache lifetime, validate that the data is
// currently valid for this user before we return it by making sure the cache
// entry was created before the timestamp in the current session's cache
......@@ -405,6 +398,9 @@ protected function prepareItem($cache) {
return FALSE;
}
if ($cache->serialized) {
$cache->data = unserialize($cache->data);
}
if (isset($cache->headers)) {
$cache->headers = unserialize($cache->headers);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment