Skip to content

Commit

Permalink
[sec-OpenMage#432] Remove support for quoted-string email address format
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmollenhour authored and edannenberg committed Oct 25, 2019
1 parent 4245322 commit 63204d4
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions lib/Zend/Validate/EmailAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 63204d4

Please sign in to comment.