Commit 0b9695b2 authored by Romain Courteaud's avatar Romain Courteaud

Improve email REGEXP, in order to handle the ' character.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22261 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 149bca80
......@@ -1656,3 +1656,11 @@ def LinesTextAreaWidget_render_view(self, field, value, REQUEST=None, render_pre
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}$')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment