Since multiple select and checkbox widgets may not appear in the post, make sure...
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 17 Apr 2008 20:54:32 +0000 (20:54 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 17 Apr 2008 20:54:32 +0000 (20:54 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13056 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/options.php

index 4ee59c7..285bb6a 100644 (file)
@@ -795,6 +795,15 @@ function save_option($option) {
     else
         setPref($data_dir, $username, $option->name, $option->new_value);
 
     else
         setPref($data_dir, $username, $option->name, $option->new_value);
 
+
+    // if a checkbox or multi select is zeroed/cleared out, it
+    // needs to have an empty value pushed into its "new_value" slot
+    //
+    if (($option->type == SMOPT_TYPE_STRLIST_MULTI
+      || $option->type == SMOPT_TYPE_BOOLEAN_CHECKBOX)
+     && is_null($option->new_value))
+        $option->new_value = '';
+
 }
 
 /**
 }
 
 /**