mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 15:10:46 +03:00
small bug in isemail
This commit is contained in:
parent
e34a7debfd
commit
b51f6ce6fd
1 changed files with 4 additions and 1 deletions
|
@ -597,7 +597,7 @@ EmailStatus isEmail (Char) (const(Char)[] email, CheckDns checkDNS = CheckDns.no
|
|||
case Token.cr:
|
||||
case Token.space:
|
||||
case Token.tab:
|
||||
if (token == Token.cr && (i++ == email.length || email.get(i, e) != Token.lf))
|
||||
if (token == Token.cr && (++i == email.length || email.get(i, e) != Token.lf))
|
||||
{
|
||||
returnStatus ~= EmailStatusCode.errorCrNoLf;
|
||||
break;
|
||||
|
@ -1129,6 +1129,9 @@ unittest
|
|||
assert("(\u000D)test@iana.org".isEmail(CheckDns.no, EmailStatusCode.any).statusCode == EmailStatusCode.errorCrNoLf,
|
||||
`No LF after the CR`);
|
||||
|
||||
assert("(\u000D".isEmail(CheckDns.no, EmailStatusCode.any).statusCode == EmailStatusCode.errorCrNoLf,
|
||||
`No LF after the CR`);
|
||||
|
||||
assert("test@iana.org(\u000D)".isEmail(CheckDns.no, EmailStatusCode.any).statusCode == EmailStatusCode.errorCrNoLf,
|
||||
`No LF after the CR`);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue