fix too strict regex for email

git-svn-id: http://piwigo.org/svn/trunk@2507 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
nikrou
2008-09-07 11:05:15 +00:00
parent 157695d7b1
commit fae1a63124
+4 -1
View File
@@ -41,7 +41,10 @@ function validate_mail_address($user_id, $mail_address)
return '';
}
$regex = '/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)*\.[a-z]+$/';
$atom = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]'; // before arobase
$domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name
$regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i';
if ( !preg_match( $regex, $mail_address ) )
{
return l10n('reg_err_mail_address');