I don't think inactive_user_custom_settings_validate($form, &$form_state) has been validating email addresses in the E-mail Addresses' field at admin/user/inactive-user. The original code for this function:

function inactive_user_custom_settings_validate($form, &$form_state) {
  $mails = explode(',', $edit['inactive_user_admin_email']);
  foreach ($mails as $mail) {
    if ($mail && !valid_email_address(trim($mail))) {
      $invalid[] = $mail;
      $count++;
    }
  }
  if ($count ==  1) {
    form_set_error('inactive_user_admin_email', t('%mail is not a valid e-mail address', array('%mail' => $invalid[0])));
  }
  elseif ($count > 1) {
    form_set_error('inactive_user_admin_email', t('The following e-mail addresses are invalid: %mail', array('%mail' => implode(', ', $invalid))));
  }
}

Put anything in the E-mail Addresses field. message status will return "The configuration options have been saved."

This is the rewritten function in the patch:

function inactive_user_custom_settings_validate($form, &$form_state) {
  $valid_email = $form_state['values']['inactive_user_admin_email'];
  $mails = explode(',', $valid_email);
  $count = 0;
  foreach ($mails as $mail) {
    if ($mail && !valid_email_address(trim($mail))) {
      $invalid[] = $mail;
      $count++;
    }
  }
  if ($count ==  1) {
    form_set_error('inactive_user_admin_email', t('%mail is not a valid e-mail address', array('%mail' => $invalid[0])));
  }
  elseif ($count > 1) {
    form_set_error('inactive_user_admin_email', t('The following e-mail addresses are invalid: %mail', array('%mail' => implode(', ', $invalid))));
  }
}

The validation works now. Patch attached.

Comments

deekayen’s picture

Status: Needs review » Fixed

Committed to 6.x-1.x and master.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.