File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -424,15 +424,12 @@ private function _validateLocalPart()
424424 if (preg_match ('/^[ ' . $ atext . ']+(\x2e+[ ' . $ atext . ']+)*$/ ' , $ this ->_localPart )) {
425425 $ result = true ;
426426 } else {
427- // Try quoted string format
428-
429- // Quoted-string characters are: DQUOTE *([FWS] qtext/quoted-pair) [FWS] DQUOTE
430- // qtext: Non white space controls, and the rest of the US-ASCII characters not
431- // including "\" or the quote character
432- $ noWsCtl = '\x01-\x08\x0b\x0c\x0e-\x1f\x7f ' ;
433- $ qtext = $ noWsCtl . '\x21\x23-\x5b\x5d-\x7e ' ;
434- $ ws = '\x20\x09 ' ;
435- if (preg_match ('/^\x22([ ' . $ ws . $ qtext . '])*[$ws]?\x22$/ ' , $ this ->_localPart )) {
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 )) {
436433 $ result = true ;
437434 } else {
438435 $ this ->_error (self ::DOT_ATOM );
You can’t perform that action at this time.
0 commit comments