diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2007-07-01 16:34:20 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2007-07-01 16:34:20 +0200 |
commit | e59767e15f7dd511c341cef3683fe6a83fc7651b (patch) | |
tree | 3fc1bb3deec2bcd97ca14a43500e0df229a828c6 | |
parent | 74351519c2b0fe4ecd2db0d6a932dc2f72960e12 (diff) |
make sure to not throw a notice when data is not cached
-rw-r--r-- | includes/BagOStuff.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/BagOStuff.php b/includes/BagOStuff.php index 969450a5..d1c93c2a 100644 --- a/includes/BagOStuff.php +++ b/includes/BagOStuff.php @@ -519,7 +519,11 @@ class APCBagOStuff extends BagOStuff { */ class XCacheBagOStuff extends BagOStuff { public function get( $key ) { - return unserialize(xcache_get($key)); + $val = xcache_get( $key ); + if ( is_string( $val ) ) { + $val = unserialize( $val ); + } + return $val; } public function set( $key, $value, $exptime = 0 ) { |