complaying to RFC1035 about domain names

This commit is contained in:
Eduardo Gulias Davis
2020-11-10 11:22:03 +01:00
parent e00a58a84e
commit a7a69112df
2 changed files with 18 additions and 6 deletions
+12
View File
@@ -36,6 +36,12 @@ class EmailLexer extends AbstractLexer
const S_EMPTY = null;
const GENERIC = 300;
const CRLF = 301;
const ASTERISK = 42;
const EXCLAMATION = 33;
const AMPERSAND = 38;
const CARET = 94;
const PERCENTAGE = 37;
const DOLLAR = 36;
const INVALID = 302;
const ASCII_INVALID_FROM = 127;
const ASCII_INVALID_TO = 199;
@@ -73,6 +79,12 @@ class EmailLexer extends AbstractLexer
'}' => self::S_CLOSEQBRACKET,
'' => self::S_EMPTY,
'\0' => self::C_NUL,
'*' => self::ASTERISK,
'!' => self::EXCLAMATION,
'&' => self::AMPERSAND,
'^' => self::CARET,
'$' => self::DOLLAR,
'%' => self::PERCENTAGE,
);
/**
@@ -70,12 +70,6 @@ class RFCValidationDomainPartTest extends TestCase
['example@faked(fake).co.uk'],
['инфо@письмо.рф'],
['müller@möller.de'],
['test@email*'],
['test@email!'],
['test@email&'],
['test@email^'],
['test@email%'],
['test@email$'],
["1500111@профи-инвест.рф"],
['validipv6@[IPv6:2001:db8:1ff::a0b:dbd0]'],
['validipv4@[127.0.0.0]'],
@@ -132,6 +126,12 @@ class RFCValidationDomainPartTest extends TestCase
['example@toolonglocalparttoolonglocalparttoolonglocalparttoolonglocalpart.co.uk'],
['example@toolonglocalparttoolonglocalparttoolonglocalparttoolonglocalpart.test.co.uk'],
['example@test.toolonglocalparttoolonglocalparttoolonglocalparttoolonglocalpart.co.uk'],
['test@email*'],
['test@email!'],
['test@email&'],
['test@email^'],
['test@email%'],
['test@email$'],
];
}