Index: library/Zend/Validate/EmailAddress.php =================================================================== --- library/Zend/Validate/EmailAddress.php (revision 24123) +++ library/Zend/Validate/EmailAddress.php (working copy) @@ -527,8 +527,9 @@ $this->_setValue($value); // Split email address up and disallow '..' + // and disallow addresses ending with a '.' if ((strpos($value, '..') !== false) or - (!preg_match('/^(.+)@([^@]+)$/', $value, $matches))) { + (!preg_match('/^(.+)@([^@]+[^.])$/', $value, $matches))) { $this->_error(self::INVALID_FORMAT); return false; } Index: tests/Zend/Validate/EmailAddressTest.php =================================================================== --- tests/Zend/Validate/EmailAddressTest.php (revision 24123) +++ tests/Zend/Validate/EmailAddressTest.php (working copy) @@ -554,6 +554,17 @@ { $this->assertTrue($this->_validator->getDomainCheck()); } + + /** + * @group ZF-11222 + * @group ZF-11451 + */ + public function testEmailAddressesWithTrailingDotInHostPartAreRejected() + { + $this->assertFalse($this->_validator->isValid('example@gmail.com.')); + $this->assertFalse($this->_validator->isValid('test@test.co.')); + $this->assertFalse($this->_validator->isValid('test@test.co.za.')); + } public function errorHandler($errno, $errstr) {