Skip to content
Snippets Groups Projects
Commit 436dcead authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #7725 by Marius: fixed glitch in e-mail address validation code. A...

- Patch #7725 by Marius: fixed glitch in e-mail address validation code.  A subset of all e-mail addresses was rejected as valid.
parent 01f08e86
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -596,7 +596,7 @@ function drupal_specialchars($input, $quotes = ENT_NOQUOTES) { ...@@ -596,7 +596,7 @@ function drupal_specialchars($input, $quotes = ENT_NOQUOTES) {
*/ */
function valid_email_address($mail) { function valid_email_address($mail) {
$user = '[a-zA-Z0-9_\-\.\+\^!#\$%&*+\/\=\?\`\|\{\}~\']+'; $user = '[a-zA-Z0-9_\-\.\+\^!#\$%&*+\/\=\?\`\|\{\}~\']+';
$domain = '(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[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}'; $ipv4 = '[0-9]{1,3}(\.[0-9]{1,3}){3}';
$ipv6 = '[0-9a-fA-F]{1,4}(\:[0-9a-fA-F]{1,4}){7}'; $ipv6 = '[0-9a-fA-F]{1,4}(\:[0-9a-fA-F]{1,4}){7}';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment