My email adress:
marius@e.co.za
seems to be an invalid e-mail address!

To fix this bug:

In /includes/common.inc : line 554:



function valid_email_address($mail) {
  $user = '[a-zA-Z0-9_\-\.\+\^!#\$%&*+\/\=\?\`\|\{\}~\']+';
  $domain = '(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]\.?)+';
  $ipv4 = '[0-9]{1,3}(\.[0-9]{1,3}){3}';
  $ipv6 = '[0-9a-fA-F]{1,4}(\:[0-9a-fA-F]{1,4}){7}';

  return preg_match("/^$user@($domain|(\[($ipv4|$ipv6)\]))$/", $mail);
}




Change the domain to match: (add another shy grouping)


  $domain = '(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.?)+';


  // PS: The stoopid smiley in line above should not even be in preformatted text....
  //     another bug? Replace smiley(frown) with:    :_(    (remove _ )

Please e-mail me comments if I'm wrong... (Since I cannot register with my e-mail here and all...)

ttfn.

CommentFileSizeAuthor
#1 email_address_validation.patch691 bytesBèr Kessels
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Bèr Kessels’s picture

FileSize
691 bytes

I created a patch out of the pasted code.

The patch is against the latest 4.4 brach common,inc, but AFAIK it can also be appiled to HEAD.

Regards, Bèr

Morbus Iff’s picture

Dries’s picture

Committed to both the DRUPAL-4-4 and the HEAD branch. Thanks Marius and Ber.

Anonymous’s picture