From: Jan Schneider Date: Mon, 23 Aug 2010 13:07:41 +0000 (+0200) Subject: Check if unserialization failed. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7655b0e9d446eab18572a091adf79201a2a02b25;p=horde.git Check if unserialization failed. --- diff --git a/turba/lib/Turba.php b/turba/lib/Turba.php index fc53c6ba5..63faa61f6 100644 --- a/turba/lib/Turba.php +++ b/turba/lib/Turba.php @@ -587,7 +587,7 @@ class Turba { /* Add the new addressbook to the user's list of visible address * books. */ $prefs = json_decode($GLOBALS['prefs']->getValue('addressbooks')); - if (array_search($share_id, $prefs) === false) { + if (!is_array($prefs) || array_search($share_id, $prefs) === false) { $prefs[] = $share_id; $GLOBALS['prefs']->setValue('addressbooks', json_encode($prefs)); }