diff options
author | Chris Smith <chris@jalakai.co.uk> | 2007-06-27 20:46:03 +0200 |
---|---|---|
committer | Chris Smith <chris@jalakai.co.uk> | 2007-06-27 20:46:03 +0200 |
commit | 591d30adeabc0280cfffb8768d0940e43db759ea (patch) | |
tree | ed78857af47d24cddf65322eb74e8baab164f082 /inc/mail.php | |
parent | 31e7c81b025f44f83624e4b5979f4c724a8f4b5f (diff) | |
download | rpg-591d30adeabc0280cfffb8768d0940e43db759ea.tar.gz rpg-591d30adeabc0280cfffb8768d0940e43db759ea.tar.bz2 |
update email address validation to support 'museum' & 'travel' tlds
darcs-hash:20070627184603-d26fc-b557a7f1c2ed4be7d967a25e64ca71b68095e6d5.gz
Diffstat (limited to 'inc/mail.php')
-rw-r--r-- | inc/mail.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/inc/mail.php b/inc/mail.php index bd05f31eb..a75aeefc4 100644 --- a/inc/mail.php +++ b/inc/mail.php @@ -159,11 +159,11 @@ function mail_encode_address($string,$header='',$names=true){ // NOTE: there is an unquoted '/' in RFC2822_ATEXT, it must remain unquoted to be used in the parser // the pattern uses non-capturing groups as captured groups aren't allowed in the parser // select pattern delimiters with care! -if (!defined('RFC2822_ATEXT')) define('RFC2822_ATEXT',"0-9A-Za-z!#$%&'*+/=?^_`{|}~-"); -if (!defined('PREG_PATTERN_VALID_EMAIL')) define('PREG_PATTERN_VALID_EMAIL', '['.RFC2822_ATEXT.']+(?:\.['.RFC2822_ATEXT.']+)*@(?:[0-9A-Za-z][0-9A-Za-z-]*\.)+[A-Za-z]{2,4}'); +if (!defined('RFC2822_ATEXT')) define('RFC2822_ATEXT',"0-9a-z!#$%&'*+/=?^_`{|}~-"); +if (!defined('PREG_PATTERN_VALID_EMAIL')) define('PREG_PATTERN_VALID_EMAIL', '['.RFC2822_ATEXT.']+(?:\.['.RFC2822_ATEXT.']+)*@(?:[0-9a-z][0-9a-z-]*\.)+(?:[a-z]{2,4}|museum|travel)'); function mail_isvalid($email){ - return preg_match('<^'.PREG_PATTERN_VALID_EMAIL.'$>', $email); + return preg_match('<^'.PREG_PATTERN_VALID_EMAIL.'$>i', $email); } /** |