Email validation in 7 is done by this function:

function valid_email_address($mail) {
  return (bool)filter_var($mail, FILTER_VALIDATE_EMAIL);
}

This relies on the PHP running on the server to validate the email. Seems this isn't consistent. On my Mac I got random fails when certain chars (high ascii I think) got used. On our product Ubuntu machine, anything w/o a TLD got denied.

Since we're not really testing email validation, I decided to add TLD support (and make a helper function to reduce code duplication).

Comments

JacobSingh’s picture

Title: Tests fail on some environments » Tests fail on some environments which require Top Level Domains

renaming because this doesn't address the random failure issue.

dave reid’s picture

Title: Tests fail on some environments which require Top Level Domains » Tests fail on some environments

We should just do what simpletest does and do $this->randomName . '@example.com'.

JacobSingh’s picture

That's fine w/ me too.

JacobSingh’s picture

StatusFileSize
new2.34 KB
greggles’s picture

Status: Needs review » Fixed

Works for me - thanks guys. Now committed http://drupal.org/cvs?commit=454854

I wonder if it's a PHP5.3 issue. I wasn't seeing this until I just upgraded my machine.

It appears that this problem doesn't affect the 6.x version so marking fixed.

Status: Fixed » Closed (fixed)

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