Index: tests/webform.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/tests/webform.test,v
retrieving revision 1.8
diff -u -r1.8 webform.test
--- tests/webform.test	3 Apr 2010 02:49:23 -0000	1.8
+++ tests/webform.test	16 Aug 2010 15:35:55 -0000
@@ -180,7 +180,7 @@
           'value' => 'two',
           'extra' => array(
             'items' => "one|one\ntwo|two\nthree|three",
-            'multiple' => 'Y',
+            'multiple' => 1,
             'email' => 0,
           ),
           'mandatory' => '0',
@@ -201,6 +201,7 @@
           'value' => '0',
           'extra' => array(
             'items' => "0|zero\n1|one\n2|two",
+            'multiple' => 1,
             'email' => 0,
           ),
           'mandatory' => '1',
@@ -209,7 +210,7 @@
           'weight' => '-9',
           'page_num' => 1,
         ),
-        'sample values' => '0',
+        'sample values' => array('0' => TRUE),
         'database values' => array('0'),
         'database default values' => array('0'),
       ),
@@ -262,7 +263,7 @@
           'extra' => array(
             'description' => '<p>Description here</p>',
             'items' => "one|one\ntwo|two\nthree|three\nfour|four\nfive|five\nsix|six",
-            'aslist' => 'Y',
+            'aslist' => 1,
             'email' => 0,
           ),
           'mandatory' => '1',
@@ -284,7 +285,7 @@
           'extra' => array(
             'description' => '<p>Tests saving zero as a value.</p>',
             'items' => "0|zero\n1|one\n2|two",
-            'aslist' => 'Y',
+            'aslist' => 1,
             'email' => 0,
           ),
           'mandatory' => '1',
@@ -306,7 +307,7 @@
           'extra' => array(
             'description' => '<p>Tests saving zero as a value.</p>',
             'items' => "<Group 1>\noption 1-1|option 1-1\noption 1-2|option 1-2\noption 1-3|option 1-3\n<Group 2>\noption 2-1|option 2-1\noption 2-2|option 2-2\noption 2-3|option 2-3",
-            'aslist' => 'Y',
+            'aslist' => 1,
             'email' => 0,
           ),
           'mandatory' => '1',
@@ -347,8 +348,8 @@
           'value' => 'one,two',
           'extra' => array(
             'items' => "one|one\ntwo|two\nthree|three",
-            'multiple' => 'Y',
-            'aslist' => 'Y',
+            'multiple' => 1,
+            'aslist' => 1,
             'email' => 0,
           ),
           'mandatory' => '0',
Index: components/select.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/select.inc,v
retrieving revision 1.55
diff -u -r1.55 select.inc
--- components/select.inc	14 Aug 2010 21:37:16 -0000	1.55
+++ components/select.inc	16 Aug 2010 15:35:55 -0000
@@ -299,12 +299,15 @@
       }
     }
   }
-  elseif ($default_value != '') {
+  elseif ($default_value !== '') {
     // Convert default value to a list if necessary.
     if ($component['extra']['multiple']) {
-      $varray = array_filter(explode(',', $default_value));
+      $varray = explode(',', $default_value);
       foreach ($varray as $key => $v) {
-        $element['#default_value'][] = trim($v);
+        $v = trim($v);
+        if ($v !== '') {
+          $element['#default_value'][] = $v;
+        }
       }
     }
     else {
@@ -450,8 +453,9 @@
     foreach ($value as $key => $option_value) {
       // Handle options that are specified options.
       if ($option_value !== '' && isset($keys[$key])) {
-        // Checkboxes submit an *integer* value of 0 when not checked.
-        if ($option_value === 0 && $keys[$key] !== '0' && !$component['extra']['aslist'] && $component['extra']['multiple']) {
+        // Checkboxes submit an integer value of 0 when unchecked. A checkbox
+        // with a value of '0' is valid, so we can't use empty() here.
+        if ($option_value === 0 && !$component['extra']['aslist'] && $component['extra']['multiple']) {
           unset($value[$key]);
         }
         else {
