Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.265 diff -u -p -r1.265 form.inc --- includes/form.inc 4 Feb 2008 10:23:32 -0000 1.265 +++ includes/form.inc 5 Feb 2008 02:01:49 -0000 @@ -664,10 +664,10 @@ function _form_validate($elements, &$for // 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) { + // Use count() to check that arrays are not empty, and then check the + // trimmed string length since '0' is a valid possible value with some + // field types, so empty() is not usable here. + 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']))); }