Changeset 2507


Ignore:
Timestamp:
Sep 7, 2008, 1:05:15 PM (16 years ago)
Author:
nikrou
Message:

fix too strict regex for email

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_user.inc.php

    r2448 r2507  
    4242  }
    4343
    44   $regex = '/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)*\.[a-z]+$/';
     44  $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase
     45  $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name 
     46  $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i';
     47
    4548  if ( !preg_match( $regex, $mail_address ) )
    4649  {
Note: See TracChangeset for help on using the changeset viewer.