[CMF-checkins] SVN: CMF/branches/1.6/CMFDefault/ - CMFDefault.RegistrationTool: Adding single quotes to the allowed

Jens Vagelpohl jens at dataflake.org
Sat Feb 18 09:34:21 EST 2006


Log message for revision 41665:
  - CMFDefault.RegistrationTool: Adding single quotes to the allowed
    characters in the local part of an email address.
    (http://www.zope.org/Collectors/CMF/401) 
  

Changed:
  U   CMF/branches/1.6/CMFDefault/RegistrationTool.py
  U   CMF/branches/1.6/CMFDefault/tests/test_RegistrationTool.py

-=-
Modified: CMF/branches/1.6/CMFDefault/RegistrationTool.py
===================================================================
--- CMF/branches/1.6/CMFDefault/RegistrationTool.py	2006-02-18 14:33:54 UTC (rev 41664)
+++ CMF/branches/1.6/CMFDefault/RegistrationTool.py	2006-02-18 14:34:20 UTC (rev 41665)
@@ -217,7 +217,7 @@
 
 # See URL: http://www.zopelabs.com/cookbook/1033402597
 
-_TESTS = ( ( re.compile("^[0-9a-zA-Z\.\-\_\+]+\@[0-9a-zA-Z\.\-]+$")
+_TESTS = ( ( re.compile("^[0-9a-zA-Z\.\-\_\+\']+\@[0-9a-zA-Z\.\-]+$")
            , True
            , "Failed a"
            )

Modified: CMF/branches/1.6/CMFDefault/tests/test_RegistrationTool.py
===================================================================
--- CMF/branches/1.6/CMFDefault/tests/test_RegistrationTool.py	2006-02-18 14:33:54 UTC (rev 41664)
+++ CMF/branches/1.6/CMFDefault/tests/test_RegistrationTool.py	2006-02-18 14:34:20 UTC (rev 41665)
@@ -92,6 +92,21 @@
 
         self.failUnless( result is None )
 
+    def test_testPropertiesValidity_email_with_singlequote( self ):
+
+        # CMF Collector #401
+
+        tool = self._makeOne().__of__( self.root )
+        self.root.portal_membership = FauxMembershipTool()
+
+        props = { 'email' : "user'site at example.com"
+                , 'username' : 'username'
+                }
+
+        result = tool.testPropertiesValidity( props, None )
+
+        self.failUnless( result is None )
+
     def test_testPropertiesValidity_new_invalid_email( self ):
 
         tool = self._makeOne().__of__( self.root )



More information about the CMF-checkins mailing list