Index: form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.265 diff -u -r1.265 form.inc --- form.inc 4 Feb 2008 10:23:32 -0000 1.265 +++ form.inc 4 Feb 2008 17:27:19 -0000 @@ -664,10 +664,11 @@ // Validate the current input. if (!isset($elements['#validated']) || !$elements['#validated']) { if (isset($elements['#needs_validation'])) { - // We only check for trimmed string length being zero. 0 might be - // a possible value with some field types, such as radio buttons, so - // empty() is not usable here. - if ($elements['#required'] && strlen(trim($elements['#value'])) == 0) { + // Some field types, such as radio buttons, are able to have return values + // of zero. So we only check if the field is empty when a string is + // returned. + $is_empty = is_string($elements['#value']) ? empty($elements['#value']) : FALSE; + if ($elements['#required'] && $is_empty) == 0) { form_error($elements, $t('!name field is required.', array('!name' => $elements['#title']))); }