Index: admin/media.php
===================================================================
--- admin/media.php	(revision 3153)
+++ admin/media.php	(revision 3161)
@@ -146,5 +146,5 @@
 	$nb_last_dirs = (integer)($core->auth->user_prefs->interface->media_nb_last_dirs);
 	if ($nb_last_dirs > 0) {
-		$last_dirs = @unserialize($core->auth->user_prefs->interface->media_last_dirs);
+		$last_dirs = $core->auth->user_prefs->interface->media_last_dirs;
 		if (!is_array($last_dirs)) {
 			$last_dirs = array();
@@ -163,5 +163,5 @@
 		}
 		// Store new list
-		$core->auth->user_prefs->interface->put('media_last_dirs',serialize($last_dirs));
+		$core->auth->user_prefs->interface->put('media_last_dirs',$last_dirs);
 	}
 }
@@ -404,5 +404,5 @@
 if ($nb_last_dirs > 0) {
 	if (!is_array($last_dirs)) {
-		$last_dirs = @unserialize($core->auth->user_prefs->interface->media_last_dirs);
+		$last_dirs = $core->auth->user_prefs->interface->media_last_dirs;
 	}
 	if (is_array($last_dirs)) {
Index: inc/admin/class.dc.favorites.php
===================================================================
--- inc/admin/class.dc.favorites.php	(revision 3075)
+++ inc/admin/class.dc.favorites.php	(revision 3161)
@@ -52,6 +52,6 @@
 
 		if ($this->ws->prefExists('favorites')) {
-			$this->local_prefs = @unserialize($this->ws->getLocal('favorites'));
-			$this->global_prefs = @unserialize($this->ws->getGlobal('favorites'));
+			$this->local_prefs = $this->ws->getLocal('favorites');
+			$this->global_prefs = $this->ws->getGlobal('favorites');
 			// Since we never know what user puts through user:preferences ...
 			if (!is_array($this->local_prefs)) {
@@ -106,5 +106,5 @@
 			$fattr = $this->fav_defs[$p];
 		}
-		$fattr = array_merge (array('id' => null,'class'=>null),$fattr);
+		$fattr = array_merge(array('id' => null,'class' => null),$fattr);
 		if (isset($fattr['permissions'])) {
 			if (is_bool($fattr['permissions']) && !$fattr['permissions'] ) {
@@ -158,5 +158,5 @@
 		$u = explode('?',$_SERVER['REQUEST_URI']);
 		// Loop over prefs to enable active favorites
-		foreach ($this->user_prefs as $k=>&$v) {
+		foreach ($this->user_prefs as $k => &$v) {
 			if (isset($v['active_cb']) && is_callable($v['active_cb'])) {
 				// Use callback if defined to match whether favorite is active or not
@@ -164,5 +164,5 @@
 			} else {
 				// Failback active detection. We test against URI name & parameters
-				$v['active']=true; // true until something proves it is false
+				$v['active'] = true; // true until something proves it is false
 				$u = explode('?',$v['url'],2);
 				if (!preg_match('/'.preg_quote($u[0],"/").'/',$_SERVER['REQUEST_URI'])) {
@@ -203,6 +203,6 @@
 			}
 		}
-		$this->ws->put('favorites',serialize($this->global_prefs),'string','User favorites',true,true);
-		$this->ws->put('favorites',serialize($this->local_prefs));
+		$this->ws->put('favorites',$this->global_prefs,'array','User favorites',true,true);
+		$this->ws->put('favorites',$this->local_prefs);
 		$this->user_prefs = $this->getFavorites($this->local_prefs);
 	}
@@ -271,5 +271,5 @@
      */
 	public function setFavoriteIDs($ids,$global=false) {
-		$this->ws->put('favorites',serialize($ids),null,null,true,$global);
+		$this->ws->put('favorites',$ids,null,null,true,$global);
 	}
 
@@ -307,5 +307,5 @@
      */
 	public function appendMenu($menu) {
-		foreach ($this->user_prefs as $k=>$v) {
+		foreach ($this->user_prefs as $k => $v) {
 			$menu['Favorites']->addItem(
 				$v['title'],
@@ -330,5 +330,5 @@
      */
 	public function appendDashboardIcons($icons) {
-		foreach ($this->user_prefs as $k=>$v) {
+		foreach ($this->user_prefs as $k => $v) {
 			if (isset($v['dashboard_cb']) && is_callable($v['dashboard_cb'])) {
 				$v = new ArrayObject($v);
@@ -368,5 +368,5 @@
      */
 	 public function registerMultiple($data) {
-		foreach ($data as $k=>$v) {
+		foreach ($data as $k => $v) {
 			$this->register($k,$v);
 		}
Index: inc/dbschema/upgrade.php
===================================================================
--- inc/dbschema/upgrade.php	(revision 3159)
+++ inc/dbschema/upgrade.php	(revision 3161)
@@ -486,4 +486,6 @@
 				settings2array('pings','pings_uris');
 				settings2array('system','simpleMenu');
+				prefs2array('dashboard','favorites');
+				prefs2array('interface','media_last_dirs');
 			}
 
@@ -558,5 +560,5 @@
 		"AND pref_ws = '%s' ".
 		"AND pref_type = 'string'";
-	$rs = $core->con->select(sprintf($strReqSelect,$pref,$ns));
+	$rs = $core->con->select(sprintf($strReqSelect,$pref,$ws));
 	while ($rs->fetch()) {
 		$value = json_encode(unserialize($rs->pref_value));
Index: plugins/userPref/index.php
===================================================================
--- plugins/userPref/index.php	(revision 3091)
+++ plugins/userPref/index.php	(revision 3161)
@@ -27,9 +27,10 @@
 	try
 	{
-		foreach ($_POST['s'] as $ws => $s)
-		{
+		foreach ($_POST['s'] as $ws => $s) {
 			$core->auth->user_prefs->addWorkspace($ws);
-
-			foreach ($s as $k => $v) 	{
+			foreach ($s as $k => $v) {
+				if ($_POST['s_type'][$ws][$k] == 'array') {
+					$v = json_decode($v,true);
+				}
 				$core->auth->user_prefs->$ws->put($k,$v);
 			}
@@ -50,9 +51,10 @@
 	try
 	{
-		foreach ($_POST['gs'] as $ws => $s)
-		{
+		foreach ($_POST['gs'] as $ws => $s) {
 			$core->auth->user_prefs->addWorkspace($ws);
-
-			foreach ($s as $k => $v) 	{
+			foreach ($s as $k => $v) {
+				if ($_POST['gs_type'][$ws][$k] == 'array') {
+					$v = json_decode($v,true);
+				}
 				$core->auth->user_prefs->$ws->put($k,$v,null,null,true,true);
 			}
@@ -76,7 +78,14 @@
 		array(__('yes') => 1, __('no') => 0),$s['value'] ? 1 : 0);
 	} else {
-		$field = form::field(array($field_name.'['.$ws.']['.$id.']',$field_name.'_'.$ws.'_'.$id),40,null,
-		html::escapeHTML($s['value']));
-	}
+		if ($s['type'] == 'array') {
+			$field = form::field(array($field_name.'['.$ws.']['.$id.']',$field_name.'_'.$ws.'_'.$id),40,null,
+			html::escapeHTML(json_encode($s['value'])));
+		} else {
+			$field = form::field(array($field_name.'['.$ws.']['.$id.']',$field_name.'_'.$ws.'_'.$id),40,null,
+			html::escapeHTML($s['value']));
+		}
+	}
+	$type = form::hidden(array($field_name.'_type'.'['.$ws.']['.$id.']',$field_name.'_'.$ws.'_'.$id.'_type'),
+		html::escapeHTML($s['type']));
 
 	$slabel = $strong_label ? '<strong>%s</strong>' : '%s';
@@ -86,5 +95,5 @@
 	'<td scope="row"><label for="'.$field_name.'_'.$ws.'_'.$id.'">'.sprintf($slabel,html::escapeHTML($id)).'</label></td>'.
 	'<td>'.$field.'</td>'.
-	'<td>'.$s['type'].'</td>'.
+	'<td>'.$s['type'].$type.'</td>'.
 	'<td>'.html::escapeHTML($s['label']).'</td>'.
 	'</tr>';
