Skip to content

Commit 2bdd15a

Browse files
committed
update lib
1 parent de2c713 commit 2bdd15a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/cache.class.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,20 @@ public function store($key, $data, $expiration = 0) {
9292

9393
/**
9494
* Retrieve cached data by its key
95-
*
95+
*
9696
* @param string $key
9797
* @param boolean [optional] $timestamp
9898
* @return string
9999
*/
100100
public function retrieve($key, $timestamp = false) {
101-
$cachedData = $this->_loadCache();
102-
(false === $timestamp) ? $type = 'data' : $type = 'time';
103-
if (!isset($cachedData[$key][$type])) return null;
104-
return unserialize($cachedData[$key][$type]);
101+
$cachedData = $this->_loadCache();
102+
(false === $timestamp) ? $type = 'data' : $type = 'time';
103+
if (!isset($cachedData[$key][$type])) return null;
104+
105+
if ($type == 'time') {
106+
return $cachedData[$key][$type];
107+
}
108+
return unserialize($cachedData[$key][$type]);
105109
}
106110

107111
/**

0 commit comments

Comments
 (0)