[CMF-checkins] SVN: CMF/trunk/CMFDefault/ - Forward-porting fix for http://www.zope.org/Collectors/CMF/495

Jens Vagelpohl jens at dataflake.org
Fri Aug 31 13:10:55 EDT 2007


Log message for revision 79408:
  - Forward-porting fix for http://www.zope.org/Collectors/CMF/495
    from the 2.1-branch
  

Changed:
  U   CMF/trunk/CMFDefault/tests/test_utils.py
  U   CMF/trunk/CMFDefault/utils.py

-=-
Modified: CMF/trunk/CMFDefault/tests/test_utils.py
===================================================================
--- CMF/trunk/CMFDefault/tests/test_utils.py	2007-08-31 17:05:54 UTC (rev 79407)
+++ CMF/trunk/CMFDefault/tests/test_utils.py	2007-08-31 17:10:54 UTC (rev 79408)
@@ -258,6 +258,8 @@
         self.assertEqual(checkEmailAddress('username_ at example.com'), None)
         # CMF Collector issue #401
         self.assertEqual(checkEmailAddress("user'site at example.com"), None)
+        # CMF Collector issue #495
+        self.assertEqual(checkEmailAddress("user at a.example.com"), None)
         self.assertRaises(EmailAddressInvalid, checkEmailAddress,
                           'this is not an e-mail address')
         self.assertRaises(EmailAddressInvalid, checkEmailAddress,

Modified: CMF/trunk/CMFDefault/utils.py
===================================================================
--- CMF/trunk/CMFDefault/utils.py	2007-08-31 17:05:54 UTC (rev 79407)
+++ CMF/trunk/CMFDefault/utils.py	2007-08-31 17:10:54 UTC (rev 79408)
@@ -513,7 +513,7 @@
 # RFC 2821 domain: sequence of dot-separated labels
 # characters allowed in label: A-Za-z0-9-, first is a letter
 # Even though the RFC does not allow it all-numeric domains do exist
-_DOMAIN_RE = re.compile(r'[^@]{1,64}@[A-Za-z0-9][A-Za-z0-9-]+'
+_DOMAIN_RE = re.compile(r'[^@]{1,64}@[A-Za-z0-9][A-Za-z0-9-]*'
                                 r'(\.[A-Za-z0-9][A-Za-z0-9-]*)+$')
 
 security.declarePublic('checkEmailAddress')



More information about the CMF-checkins mailing list