Changeset 7323

Show
Ignore:
Timestamp:
12/18/08 14:20:58 (3 years ago)
Author:
sasargen
Message:

ARI: improved regex to check email addresses, especially to prevent unwanted commas from being added to voicemail.conf

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/htdocs/recordings/modules/settings.module

    r7319 r7323  
    467467          // voicemail email address 
    468468          if (($voicemail_email_enable || $voicemail_pager_enable) && 
    469           ($voicemail_email_address && !preg_match('/@/',$voicemail_email_address) || 
    470           ($voicemail_pager_address && !preg_match('/@/',$voicemail_pager_address)))) { 
     469          ($voicemail_email_address && !preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i',$voicemail_email_address) || 
     470          ($voicemail_pager_address && !preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i',$voicemail_pager_address)))) { 
    471471            $_SESSION['ari_error'] = 
    472472            _("Voicemail email and pager address not changed") . "<br>" .