From 24f4dd1bce66837fa64b00128e4115d70b6abfa0 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Thu, 28 Feb 2013 15:26:07 +0000 Subject: [PATCH] * Etemplate/Addressbook: switch off client side email address validation as browser rule set seems to be more restrictive than rfc822 rules suggests; implement better rfc822 compliant email address validation --- etemplate/inc/class.url_widget.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etemplate/inc/class.url_widget.inc.php b/etemplate/inc/class.url_widget.inc.php index 045d6de68e..4ad3d35b3a 100644 --- a/etemplate/inc/class.url_widget.inc.php +++ b/etemplate/inc/class.url_widget.inc.php @@ -62,7 +62,8 @@ class url_widget * has to be used case insensitive: /i */ //const EMAIL_PREG = '([a-z0-9][a-z0-9._-]*)?[a-z0-9]@([a-z0-9](|[a-z0-9_-]*[a-z0-9])\.)+[a-z]{2,6}'; - const EMAIL_PREG = '([a-z0-9][a-z0-9._\&\+-]*)?[a-z0-9_]@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}'; + //const EMAIL_PREG = '([a-z0-9][a-z0-9._\'\&\+-]*)?[a-z0-9_]@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}'; + const EMAIL_PREG = '^[^\x00-\x20()<>@,;:\\"\[\]]+@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}'; /** * pre-processing of the extension @@ -100,7 +101,8 @@ class url_widget { $cell['size'] .= '|[^<]+ ?<'.self::EMAIL_PREG.'>'; } - $cell['size'] .= ')$/i,email'; + //$cell['size'] .= ')$/iu,email';// ,email causes browser-side validation. browser is more restrictive, so we disable browserside validation + $cell['size'] .= ')$/iu'; } #_debug_array($cell); break;