summaryrefslogtreecommitdiff
path: root/inc/mail.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2008-10-12 15:27:14 +0200
committerAndreas Gohr <andi@splitbrain.org>2008-10-12 15:27:14 +0200
commitd530a62a501f6dfec02b4c3378cc82ae7d25ce9d (patch)
treefdb4fce0ca22404ca6e441b5ad0a3b77ccad4524 /inc/mail.php
parent2cff5827dfad5e43c9711f2cc4a8f3d012c75a78 (diff)
downloadrpg-d530a62a501f6dfec02b4c3378cc82ae7d25ce9d.tar.gz
rpg-d530a62a501f6dfec02b4c3378cc82ae7d25ce9d.tar.bz2
readded email patterns -> fixes email links broken with yesterdays validator switch
darcs-hash:20081012132714-7ad00-39316b19200fc122bdd4f780235e25a9fea09932.gz
Diffstat (limited to 'inc/mail.php')
-rw-r--r--inc/mail.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/inc/mail.php b/inc/mail.php
index a7a878c2d..1692f415c 100644
--- a/inc/mail.php
+++ b/inc/mail.php
@@ -16,6 +16,24 @@
#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 <chris@jalakai.co.uk>
+ * 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
*
* Email address fields (To, From, Cc, Bcc can contain a textpart and an address