diff --git a/includes/form.inc b/includes/form.inc index 13dd72a79..1db018421 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -1360,7 +1360,7 @@ function _form_validate(&$elements, &$form_state, $form_id = NULL) { // The following errors are always shown. if (isset($elements['#needs_validation'])) { // Verify that the value is not longer than #maxlength. - if (isset($elements['#maxlength']) && !is_scalar($elements['#value'])) { + if (isset($elements['#maxlength']) && (isset($elements['#value']) && !is_scalar($elements['#value']))) { form_error($elements, $t('An illegal value has been detected. Please contact the site administrator.')); } elseif (isset($elements['#maxlength']) && drupal_strlen($elements['#value']) > $elements['#maxlength']) { diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc index 5f5c2192e..fe239fe5f 100644 --- a/modules/user/user.pages.inc +++ b/modules/user/user.pages.inc @@ -66,7 +66,7 @@ function user_pass() { * @see user_pass_submit() */ function user_pass_validate($form, &$form_state) { - if (!is_scalar($form_state['values']['name'])) { + if (isset($form_state['values']['name']) && !is_scalar($form_state['values']['name'])) { form_set_error('name', t('An illegal value has been detected. Please contact the site administrator.')); return; }