mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user