Get an array back from json_decode here.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 20 Oct 2010 17:52:24 +0000 (13:52 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 20 Oct 2010 17:54:05 +0000 (13:54 -0400)
turba/lib/Turba.php

index c336b1a..9a400ba 100644 (file)
@@ -598,7 +598,7 @@ class Turba {
 
         /* Add the new addressbook to the user's list of visible address
          * books. */
-        $prefs = json_decode($GLOBALS['prefs']->getValue('addressbooks'));
+        $prefs = json_decode($GLOBALS['prefs']->getValue('addressbooks'), true);
         if (!is_array($prefs) || array_search($share_id, $prefs) === false) {
             $prefs[] = $share_id;
             $GLOBALS['prefs']->setValue('addressbooks', json_encode($prefs));