Skip to content

Commit 1504f7f

Browse files
colinmollenhouredannenberg
authored andcommitted
[sec-OpenMage#432] Remove support for quoted-string email address format
fixes OpenMage#387
1 parent 2117068 commit 1504f7f

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

lib/Zend/Validate/EmailAddress.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -424,18 +424,8 @@ private function _validateLocalPart()
424424
if (preg_match('/^[' . $atext . ']+(\x2e+[' . $atext . ']+)*$/', $this->_localPart)) {
425425
$result = true;
426426
} else {
427-
// Try quoted string format (RFC 5321 Chapter 4.1.2)
428-
429-
// Quoted-string characters are: DQUOTE *(qtext/quoted-pair) DQUOTE
430-
$qtext = '\x20-\x21\x23-\x5b\x5d-\x7e'; // %d32-33 / %d35-91 / %d93-126
431-
$quotedPair = '\x20-\x7e'; // %d92 %d32-126
432-
if (preg_match('/^"(['. $qtext .']|\x5c[' . $quotedPair . '])*"$/', $this->localPart)) {
433-
$result = true;
434-
} else {
435-
$this->_error(self::DOT_ATOM);
436-
$this->_error(self::QUOTED_STRING);
437-
$this->_error(self::INVALID_LOCAL_PART);
438-
}
427+
$this->_error(self::DOT_ATOM);
428+
$this->_error(self::INVALID_LOCAL_PART);
439429
}
440430

441431
return $result;

0 commit comments

Comments
 (0)