Ignore:
Timestamp:
Sep 23, 2012, 11:34:30 AM (12 years ago)
Author:
mistic100
Message:

feature 2754: Add "Email" field for user comments + mandatory "Author"

File:
1 edited

Legend:

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

    r13240 r18164  
    4242  }
    4343
    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 
    48   if ( !preg_match( $regex, $mail_address ) )
     44  if ( !email_check_format($mail_address) )
    4945  {
    5046    return l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)');
     
    5450  {
    5551    $query = '
    56 select count(*)
    57 from '.USERS_TABLE.'
    58 where upper('.$conf['user_fields']['email'].') = upper(\''.$mail_address.'\')
    59 '.(is_numeric($user_id) ? 'and '.$conf['user_fields']['id'].' != \''.$user_id.'\'' : '').'
     52SELECT count(*)
     53FROM '.USERS_TABLE.'
     54WHERE upper('.$conf['user_fields']['email'].') = upper(\''.$mail_address.'\')
     55'.(is_numeric($user_id) ? 'AND '.$conf['user_fields']['id'].' != \''.$user_id.'\'' : '').'
    6056;';
    6157    list($count) = pwg_db_fetch_row(pwg_query($query));
Note: See TracChangeset for help on using the changeset viewer.