[Erp5-report] r22261 - /erp5/trunk/products/ERP5Form/FormulatorPatch.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jul 3 17:39:42 CEST 2008


Author: romain
Date: Thu Jul  3 17:39:39 2008
New Revision: 22261

URL: http://svn.erp5.org?rev=22261&view=rev
Log:
Improve email REGEXP, in order to handle the ' character.

Modified:
    erp5/trunk/products/ERP5Form/FormulatorPatch.py

Modified: erp5/trunk/products/ERP5Form/FormulatorPatch.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/FormulatorPatch.py?rev=22261&r1=22260&r2=22261&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/FormulatorPatch.py (original)
+++ erp5/trunk/products/ERP5Form/FormulatorPatch.py Thu Jul  3 17:39:39 2008
@@ -1656,3 +1656,11 @@
   return original_LinesTextAreaWidget_render_view(self, field, value)
 LinesTextAreaWidget.render_view = LinesTextAreaWidget_render_view
 
+from Products.Formulator.Validator import EmailValidator
+import re
+# This regexp is based on the default Formulator regexp, and add the
+# possibility to allow ' in the email address
+# see: http://www.regular-expressions.info/email.html
+EmailValidator.pattern = \
+  re.compile('^[0-9a-zA-Z_\'&.%+-]+@([0-9a-zA-Z]([0-9a-zA-Z-]*[0-9a-zA-Z])?\.)+[a-zA-Z]{2,6}$')
+




More information about the Erp5-report mailing list