From b4f1a9eede1aa9cb19d4e3116de26d301dc080fc Mon Sep 17 00:00:00 2001 From: pdontthink Date: Thu, 17 Apr 2008 20:54:32 +0000 Subject: [PATCH] Since multiple select and checkbox widgets may not appear in the post, make sure empty values are pushed into the object's new value slot when saving git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13056 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/options.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/functions/options.php b/functions/options.php index 4ee59c73..285bb6ae 100644 --- a/functions/options.php +++ b/functions/options.php @@ -795,6 +795,15 @@ function save_option($option) { 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 = ''; + } /** -- 2.25.1