Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.400
diff -u -r1.400 form.inc
--- includes/form.inc	16 Nov 2009 05:11:01 -0000	1.400
+++ includes/form.inc	17 Nov 2009 00:31:20 -0000
@@ -831,9 +831,9 @@
       // A simple call to empty() will not cut it here as some fields, like
       // checkboxes, can return a valid value of '0'. Instead, check the
       // length if it's a string, and the item count if it's an array.
-      // An unchecked checkbox has a #value of numeric 0, different than string
-      // '0', which could be a valid value.
-      if ($elements['#required'] && (!count($elements['#value']) || (is_string($elements['#value']) && strlen(trim($elements['#value'])) == 0) || $elements['#value'] === 0)) {
+      // Unchecked checkboxes have a #value of ''; see
+      // form_type_checkbox_value().
+      if ($elements['#required'] && (!count($elements['#value']) || (is_string($elements['#value']) && strlen(trim($elements['#value'])) == 0))) {
         form_error($elements, $t('!name field is required.', array('!name' => $elements['#title'])));
       }
 
@@ -1417,9 +1417,9 @@
     if (empty($element['#disabled'])) {
       // Successful (checked) checkboxes are present with a value (possibly '0').
       // http://www.w3.org/TR/html401/interact/forms.html#successful-controls
-      // For an unchecked checkbox, we return numeric 0, so we can explicitly
-      // test for a value different than string '0'.
-      return isset($input) ? $element['#return_value'] : 0;
+      // For an unchecked checkbox, we return '', so we can explicitly
+      // test for a value.
+      return isset($input) ? $element['#return_value'] : '';
     }
     else {
       // Disabled form controls are not submitted by the browser. Ignore any
@@ -2133,7 +2133,7 @@
   $checkbox .= 'id="' . $element['#id'] . '" ' ;
   $checkbox .= 'value="' . $element['#return_value'] . '" ';
   // Unchecked checkbox has #value of numeric 0.
-  if ($element['#value'] !== 0 && $element['#value'] == $element['#return_value']) {
+  if ($element['#value'] !== '' && $element['#value'] == $element['#return_value']) {
     $checkbox .= 'checked="checked" ';
   }
   $checkbox .= drupal_attributes($element['#attributes']) . ' />';
@@ -3090,7 +3090,7 @@
   $batch =& batch_get();
 
   drupal_theme_initialize();
-  
+
   if (isset($batch)) {
     // Add process information
     $process_info = array(
@@ -3105,7 +3105,7 @@
     );
     $batch += $process_info;
 
-    // The batch is now completely built. Allow other modules to make changes to the 
+    // The batch is now completely built. Allow other modules to make changes to the
     // batch so that it is easier to reuse batch processes in other enviroments.
     drupal_alter('batch', $batch);
 
