Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | email_address_validation.patch | 691 bytes | Bèr Kessels |
Comments
Comment #1
Bèr Kessels CreditAttribution: Bèr Kessels commentedI 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
Comment #2
Morbus IffComment #3
Dries CreditAttribution: Dries commentedCommitted to both the DRUPAL-4-4 and the HEAD branch. Thanks Marius and Ber.
Comment #4
(not verified) CreditAttribution: commented