From 7bb254e27fd4e92e1adc0557b250bb4ac8504210 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 10 Jun 2010 15:34:52 +0000 Subject: [PATCH] fixed PHP notice --- lam/lib/cache.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lam/lib/cache.inc b/lam/lib/cache.inc index eb7d5736..abfbc658 100644 --- a/lam/lib/cache.inc +++ b/lam/lib/cache.inc @@ -183,9 +183,13 @@ class cache { * @return array list of variables to save */ function __sleep() { - $this->ldapcache = $_SESSION['ldap']->encrypt(serialize($this->ldapcache)); + $attrs = array("attributes", "time"); + if (isset($this->ldapcache)) { + $this->ldapcache = $_SESSION['ldap']->encrypt(serialize($this->ldapcache)); + $attrs[] = 'ldapcache'; + } // define which attributes to save - return array("ldapcache", "attributes", "time"); + return $attrs; } /**