diff --git a/lib/Cake/Network/Email/CakeEmail.php b/lib/Cake/Network/Email/CakeEmail.php index 8733a66758b..5099ba5ce98 100644 --- a/lib/Cake/Network/Email/CakeEmail.php +++ b/lib/Cake/Network/Email/CakeEmail.php @@ -65,6 +65,13 @@ class CakeEmail { */ const MESSAGE_TEXT = 'text'; +/** + * Holds the regex pattern for email validation + * + * @var string + */ + const EMAIL_PATTERN = '/^((?:[\p{L}0-9.!#$%&\'*+\/=?^_`{|}~-]+)*@[\p{L}0-9-.]+)$/ui'; + /** * Recipient of the email * @@ -320,7 +327,7 @@ class CakeEmail { * * @var string */ - protected $_emailPattern = '/^((?:[\p{L}0-9.!#$%&\'*+\/=?^_`{|}~-]+)*@[\p{L}0-9-.]+)$/ui'; + protected $_emailPattern = self::EMAIL_PATTERN; /** * The class name used for email configuration. @@ -1291,7 +1298,7 @@ public function reset() { $this->headerCharset = null; $this->_attachments = array(); $this->_config = array(); - $this->_emailPattern = null; + $this->_emailPattern = self::EMAIL_PATTERN; return $this; }