diff -ruN phpgroupware.orig/phpgwapi/inc/class.preferences.inc.php phpgroupware/phpgwapi/inc/class.preferences.inc.php
--- phpgroupware.orig/phpgwapi/inc/class.preferences.inc.php	2005-10-06 04:20:12.000000000 -0500
+++ phpgroupware/phpgwapi/inc/class.preferences.inc.php	2007-06-07 18:33:51.000000000 -0500
@@ -515,9 +515,9 @@
 
 				foreach($prefs as $app => $value)
 				{
-					if (!is_array($value)) continue;
-					$this->quote($value);
+					if (!is_array($value)) continue; 
 					$value = $this->db->db_addslashes(serialize($value));	// this addslashes is for the database
+					$this->quote($value);
 					$app = $this->db->db_addslashes($app);
 					
 					$this->db->query($sql = "INSERT INTO phpgw_preferences".
