From 7655b0e9d446eab18572a091adf79201a2a02b25 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Mon, 23 Aug 2010 15:07:41 +0200 Subject: [PATCH] Check if unserialization failed. --- turba/lib/Turba.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); } -- 2.11.0