From e59767e15f7dd511c341cef3683fe6a83fc7651b Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 1 Jul 2007 16:34:20 +0200 Subject: make sure to not throw a notice when data is not cached --- includes/BagOStuff.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'includes/BagOStuff.php') 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 ) { -- cgit v1.2.3-54-g00ecf