From df8f4449e8df67fd8446dc3c1e875ec145f5eebb Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Fri, 3 Dec 2010 12:03:05 +0000 Subject: [PATCH] Fix for Trac #337: email validation. Use a simpler regular expression that is much faster to execute. SVN:trunk[1009] --- core/attributedef.class.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index 81febee9b..4601e7092 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -1092,7 +1092,8 @@ class AttributeEmailAddress extends AttributeString { public function GetValidationPattern() { - return "^([0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$"; + // return "^([0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$"; + return "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$"; } public function GetAsHTML($sValue)