Skip to content

Commit bd0b4b3

Browse files
committed
Fix issue bcit-ci#1543
1 parent c955acf commit bd0b4b3

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

system/libraries/Cache/drivers/Cache_file.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,12 @@ public function get_metadata($id)
151151
{
152152
return FALSE;
153153
}
154-
155-
$data = read_file($this->_cache_path.$id);
154+
155+
$data = read_file($this->_cache_path.$id);
156156
$data = unserialize($data);
157-
157+
158158
if (is_array($data))
159159
{
160-
$data = $data['data'];
161160
$mtime = filemtime($this->_cache_path.$id);
162161

163162
if ( ! isset($data['ttl']))
@@ -166,11 +165,11 @@ public function get_metadata($id)
166165
}
167166

168167
return array(
169-
'expire' => $mtime + $data['ttl'],
168+
'expire' => $mtime + $data['ttl'],
170169
'mtime' => $mtime
171170
);
172171
}
173-
172+
174173
return FALSE;
175174
}
176175

user_guide/changelog.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@
5757

5858
<h1>Change Log</h1>
5959

60+
<h2>Version 2.1.3</h2>
61+
<p>Release Date: Not Released</p>
62+
63+
<h3>Bug fixes for 2.1.3:</h3>
64+
<ul>
65+
<li>Fixed a bug (#1543) - <a href="libraries/caching.html#file">File-based Caching</a> method <samp>get_metadata()</samp> used a non-existent array key to look for the TTL value.</li>
66+
</ul>
67+
6068
<h2>Version 2.1.2</h2>
6169
<p>Release Date: June 29, 2012</p>
6270

0 commit comments

Comments
 (0)