diff --git a/composer.lock b/composer.lock index d265eaa..caaf41a 100644 --- a/composer.lock +++ b/composer.lock @@ -269,17 +269,17 @@ }, { "name": "symfony/config", - "version": "v2.5.6", + "version": "v2.6.1", "target-dir": "Symfony/Component/Config", "source": { "type": "git", "url": "https://github.com/symfony/Config.git", - "reference": "0316364bfebc8b080077c731a99f189341476bd7" + "reference": "84c0c150c1520995f09ea9e47e817068b353cb0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/0316364bfebc8b080077c731a99f189341476bd7", - "reference": "0316364bfebc8b080077c731a99f189341476bd7", + "url": "https://api.github.com/repos/symfony/Config/zipball/84c0c150c1520995f09ea9e47e817068b353cb0f", + "reference": "84c0c150c1520995f09ea9e47e817068b353cb0f", "shasum": "" }, "require": { @@ -289,7 +289,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -313,21 +313,21 @@ ], "description": "Symfony Config Component", "homepage": "http://symfony.com", - "time": "2014-09-23 05:25:11" + "time": "2014-12-02 20:19:20" }, { "name": "symfony/console", - "version": "v2.5.6", + "version": "v2.6.1", "target-dir": "Symfony/Component/Console", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "6f177fca24200a5b97aef5ce7a5c98124a0f0db0" + "reference": "ef825fd9f809d275926547c9e57cbf14968793e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/6f177fca24200a5b97aef5ce7a5c98124a0f0db0", - "reference": "6f177fca24200a5b97aef5ce7a5c98124a0f0db0", + "url": "https://api.github.com/repos/symfony/Console/zipball/ef825fd9f809d275926547c9e57cbf14968793e8", + "reference": "ef825fd9f809d275926547c9e57cbf14968793e8", "shasum": "" }, "require": { @@ -335,16 +335,18 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1" + "symfony/event-dispatcher": "~2.1", + "symfony/process": "~2.1" }, "suggest": { "psr/log": "For using the console logger", - "symfony/event-dispatcher": "" + "symfony/event-dispatcher": "", + "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -368,21 +370,21 @@ ], "description": "Symfony Console Component", "homepage": "http://symfony.com", - "time": "2014-10-05 13:57:04" + "time": "2014-12-02 20:19:20" }, { "name": "symfony/event-dispatcher", - "version": "v2.5.6", + "version": "v2.6.1", "target-dir": "Symfony/Component/EventDispatcher", "source": { "type": "git", "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "804eb28dbbfba9ffdab21fe2066744906cea2212" + "reference": "720fe9bca893df7ad1b4546649473b5afddf0216" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/804eb28dbbfba9ffdab21fe2066744906cea2212", - "reference": "804eb28dbbfba9ffdab21fe2066744906cea2212", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/720fe9bca893df7ad1b4546649473b5afddf0216", + "reference": "720fe9bca893df7ad1b4546649473b5afddf0216", "shasum": "" }, "require": { @@ -391,7 +393,8 @@ "require-dev": { "psr/log": "~1.0", "symfony/config": "~2.0", - "symfony/dependency-injection": "~2.0,<2.6.0", + "symfony/dependency-injection": "~2.6", + "symfony/expression-language": "~2.6", "symfony/stopwatch": "~2.2" }, "suggest": { @@ -401,7 +404,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -425,21 +428,21 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "http://symfony.com", - "time": "2014-10-01 15:43:05" + "time": "2014-12-02 20:19:20" }, { "name": "symfony/filesystem", - "version": "v2.5.6", + "version": "v2.6.1", "target-dir": "Symfony/Component/Filesystem", "source": { "type": "git", "url": "https://github.com/symfony/Filesystem.git", - "reference": "4e62fab0060a826561c78b665925b37c870c45f5" + "reference": "ff6efc95256cb33031933729e68b01d720b5436b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/4e62fab0060a826561c78b665925b37c870c45f5", - "reference": "4e62fab0060a826561c78b665925b37c870c45f5", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/ff6efc95256cb33031933729e68b01d720b5436b", + "reference": "ff6efc95256cb33031933729e68b01d720b5436b", "shasum": "" }, "require": { @@ -448,7 +451,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -472,21 +475,21 @@ ], "description": "Symfony Filesystem Component", "homepage": "http://symfony.com", - "time": "2014-09-22 09:14:18" + "time": "2014-12-02 20:19:20" }, { "name": "symfony/stopwatch", - "version": "v2.5.6", + "version": "v2.6.1", "target-dir": "Symfony/Component/Stopwatch", "source": { "type": "git", "url": "https://github.com/symfony/Stopwatch.git", - "reference": "9f8a33a24f2378c0ec5f372a8d50b2d43069c050" + "reference": "261abd360cfb6ac65ea93ffd82073e2011d034fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/9f8a33a24f2378c0ec5f372a8d50b2d43069c050", - "reference": "9f8a33a24f2378c0ec5f372a8d50b2d43069c050", + "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/261abd360cfb6ac65ea93ffd82073e2011d034fc", + "reference": "261abd360cfb6ac65ea93ffd82073e2011d034fc", "shasum": "" }, "require": { @@ -495,7 +498,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -519,21 +522,21 @@ ], "description": "Symfony Stopwatch Component", "homepage": "http://symfony.com", - "time": "2014-09-22 09:14:18" + "time": "2014-12-02 20:19:20" }, { "name": "symfony/yaml", - "version": "v2.5.6", + "version": "v2.6.1", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "2d9f527449cabfa8543dd7fa3a466d6ae83d6726" + "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/2d9f527449cabfa8543dd7fa3a466d6ae83d6726", - "reference": "2d9f527449cabfa8543dd7fa3a466d6ae83d6726", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/3346fc090a3eb6b53d408db2903b241af51dcb20", + "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20", "shasum": "" }, "require": { @@ -542,7 +545,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -566,7 +569,7 @@ ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2014-10-01 05:50:18" + "time": "2014-12-02 20:19:20" } ], "aliases": [], @@ -576,6 +579,7 @@ "satooshi/php-coveralls": 20 }, "prefer-stable": false, + "prefer-lowest": false, "platform": { "php": ">= 5.3.3" }, diff --git a/src/Egulias/EmailValidator/Parser/DomainPart.php b/src/Egulias/EmailValidator/Parser/DomainPart.php index 33875a4..b187d28 100644 --- a/src/Egulias/EmailValidator/Parser/DomainPart.php +++ b/src/Egulias/EmailValidator/Parser/DomainPart.php @@ -104,6 +104,10 @@ protected function doParseDomainPart() { $domain = ''; do { + if ($this->lexer->token['type'] === EmailLexer::S_SEMICOLON) { + throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); + } + $prev = $this->lexer->getPrevious(); if ($this->lexer->token['type'] === EmailLexer::S_SLASH) { diff --git a/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php b/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php index 395bc8b..f7173c8 100644 --- a/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php +++ b/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php @@ -108,6 +108,7 @@ public function getInvalidEmails() array('test@iana.org \r\n\r\n'), array('test@iana.org \r\n\r\n '), array('test@iana/icann.org'), + array('test@foo;bar.com'), ); } @@ -173,13 +174,32 @@ public function testInvalidEmailsWithDnsCheckAndStrictMode($warnings, $email) public function getInvalidEmailsWithWarnings() { return array( - array(array( EmailValidator::DEPREC_CFWS_NEAR_AT,), 'example @example.co.uk'), - array(array( EmailValidator::DEPREC_CFWS_NEAR_AT,), 'example@ example.co.uk'), - array(array( EmailValidator::CFWS_COMMENT,), 'example@example(examplecomment).co.uk'), + array( + array( + EmailValidator::DEPREC_CFWS_NEAR_AT, + EmailValidator::DNSWARN_NO_RECORD + ), + 'example @example.co.uk' + ), + array( + array( + EmailValidator::DEPREC_CFWS_NEAR_AT, + EmailValidator::DNSWARN_NO_RECORD + ), + 'example@ example.co.uk' + ), + array( + array( + EmailValidator::CFWS_COMMENT, + EmailValidator::DNSWARN_NO_RECORD + ), + 'example@example(examplecomment).co.uk' + ), array( array( EmailValidator::CFWS_COMMENT, EmailValidator::DEPREC_CFWS_NEAR_AT, + EmailValidator::DNSWARN_NO_RECORD, ), 'example(examplecomment)@example.co.uk' ), @@ -187,6 +207,7 @@ public function getInvalidEmailsWithWarnings() array( EmailValidator::RFC5321_QUOTEDSTRING, EmailValidator::CFWS_FWS, + EmailValidator::DNSWARN_NO_RECORD, ), "\"\t\"@example.co.uk" ), @@ -194,6 +215,7 @@ public function getInvalidEmailsWithWarnings() array( EmailValidator::RFC5321_QUOTEDSTRING, EmailValidator::CFWS_FWS, + EmailValidator::DNSWARN_NO_RECORD ), "\"\r\"@example.co.uk" ), @@ -285,12 +307,14 @@ public function getInvalidEmailsWithWarnings() array( array( EmailValidator::RFC5321_QUOTEDSTRING, + EmailValidator::DNSWARN_NO_RECORD ), '"example"@example.co.uk' ), array( array( EmailValidator::RFC5322_LOCAL_TOOLONG, + EmailValidator::DNSWARN_NO_RECORD ), 'too_long_localpart_too_long_localpart_too_long_localpart_too_long_localpart@example.co.uk' ),