diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-03-07 07:26:13 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-03-07 07:26:13 +0000 |
commit | 58f1f75e07553a8eebd13d72cfd7d342a080e60f (patch) | |
tree | 4e1761fc8bbcb91e4fe83f0eb724f76cc047e0d0 | |
parent | 3ae281d03226446a8748ff075e4f082f61bc36a9 (diff) | |
download | brdo-58f1f75e07553a8eebd13d72cfd7d342a080e60f.tar.gz brdo-58f1f75e07553a8eebd13d72cfd7d342a080e60f.tar.bz2 |
#718636 by mfb: Fixed Cache returns serialized data only in certain conditions.
-rw-r--r-- | includes/cache.inc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/includes/cache.inc b/includes/cache.inc index e691c1720..e3194d31b 100644 --- a/includes/cache.inc +++ b/includes/cache.inc @@ -387,13 +387,6 @@ class DrupalDatabaseCache implements DrupalCacheInterface { 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 @@ class DrupalDatabaseCache implements DrupalCacheInterface { return FALSE; } + if ($cache->serialized) { + $cache->data = unserialize($cache->data); + } if (isset($cache->headers)) { $cache->headers = unserialize($cache->headers); } |