From 63204d4b58222c137d4c69b202c8b2c12634a2e1 Mon Sep 17 00:00:00 2001 From: Colin Mollenhour Date: Thu, 8 Feb 2018 17:05:12 -0500 Subject: [PATCH] [sec-#432] Remove support for quoted-string email address format fixes #387 --- lib/Zend/Validate/EmailAddress.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/Zend/Validate/EmailAddress.php b/lib/Zend/Validate/EmailAddress.php index dd2523d32ab..22c896a8941 100644 --- a/lib/Zend/Validate/EmailAddress.php +++ b/lib/Zend/Validate/EmailAddress.php @@ -424,18 +424,8 @@ private function _validateLocalPart() if (preg_match('/^[' . $atext . ']+(\x2e+[' . $atext . ']+)*$/', $this->_localPart)) { $result = true; } else { - // Try quoted string format (RFC 5321 Chapter 4.1.2) - - // Quoted-string characters are: DQUOTE *(qtext/quoted-pair) DQUOTE - $qtext = '\x20-\x21\x23-\x5b\x5d-\x7e'; // %d32-33 / %d35-91 / %d93-126 - $quotedPair = '\x20-\x7e'; // %d92 %d32-126 - if (preg_match('/^"(['. $qtext .']|\x5c[' . $quotedPair . '])*"$/', $this->localPart)) { - $result = true; - } else { - $this->_error(self::DOT_ATOM); - $this->_error(self::QUOTED_STRING); - $this->_error(self::INVALID_LOCAL_PART); - } + $this->_error(self::DOT_ATOM); + $this->_error(self::INVALID_LOCAL_PART); } return $result;