Skip to content

Commit bffc067

Browse files
author
Jordan Hall
committed
Serialize all content and remove error suppression (fixes #5)
1 parent 46db7c7 commit bffc067

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/DOFileCache.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ public function set($key, $content, $expiry = 0)
4949
{
5050
$cacheObj = new \stdClass();
5151

52-
if (!is_string($content)) {
53-
$content = serialize($content);
54-
}
55-
56-
$cacheObj->content = $content;
52+
$cacheObj->content = serialize($content);
5753

5854
if (!$expiry) {
5955
// If no expiry specified, set to 'Never' expire timestamp (+10 years)
@@ -133,7 +129,7 @@ public function get($key)
133129
// Cache item has not yet expired or system load is too high
134130
$content = $cacheObj->content;
135131

136-
if (($unserializedContent = @unserialize($content)) !== false) {
132+
if (($unserializedContent = unserialize($content)) !== false) {
137133
// Normal unserialization
138134
$content = $unserializedContent;
139135
} elseif ($content == serialize(false)) {

0 commit comments

Comments
 (0)