From d530a62a501f6dfec02b4c3378cc82ae7d25ce9d Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 12 Oct 2008 15:27:14 +0200 Subject: readded email patterns -> fixes email links broken with yesterdays validator switch darcs-hash:20081012132714-7ad00-39316b19200fc122bdd4f780235e25a9fea09932.gz --- inc/mail.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'inc/mail.php') diff --git a/inc/mail.php b/inc/mail.php index a7a878c2d..1692f415c 100644 --- a/inc/mail.php +++ b/inc/mail.php @@ -15,6 +15,24 @@ if(!defined('MAILHEADER_EOL')) define('MAILHEADER_EOL',"\n"); #define('MAILHEADER_ASCIIONLY',1); +/** + * Patterns for use in email detection and validation + * + * 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! + * + * May not be completly RFC conform! + * @link http://www.faqs.org/rfcs/rfc2822.html (paras 3.4.1 & 3.2.4) + * + * @author Chris Smith + * Check if a given mail address is valid +*/ +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.']+)*@(?i:[0-9a-z][0-9a-z-]*\.)+(?i:[a-z]{2,4}|museum|travel)'); + + + /** * UTF-8 autoencoding replacement for PHPs mail function * -- cgit v1.2.3