From: <lei...@us...> - 2013-02-28 15:23:22
|
Author: leithoff Date: Thu Feb 28 16:21:43 2013 New Revision: 41887 URL: http://svn.stylite.de/viewvc/egroupware?rev=41887&view=rev Log: * 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 Modified: trunk/etemplate/inc/class.etemplate_widget_url.inc.php trunk/etemplate/inc/class.url_widget.inc.php Modified: trunk/etemplate/inc/class.etemplate_widget_url.inc.php URL: http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/inc/class.etemplate_widget_url.inc.php?rev=41887&r1=41886&r2=41887&view=diff ============================================================================== --- trunk/etemplate/inc/class.etemplate_widget_url.inc.php (original) +++ trunk/etemplate/inc/class.etemplate_widget_url.inc.php Thu Feb 28 16:21:43 2013 @@ -21,7 +21,7 @@ /** * Regexes for validating */ - 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}'; /** * Validate input @@ -66,7 +66,7 @@ } break; case 'url-email': - $this->attrs['preg'] = '/^('.self::EMAIL_PREG.')?$/'; + $this->attrs['preg'] = '/('.self::EMAIL_PREG.')?$/iu'; break; } } Modified: trunk/etemplate/inc/class.url_widget.inc.php URL: http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/inc/class.url_widget.inc.php?rev=41887&r1=41886&r2=41887&view=diff ============================================================================== --- trunk/etemplate/inc/class.url_widget.inc.php (original) +++ trunk/etemplate/inc/class.url_widget.inc.php Thu Feb 28 16:21:43 2013 @@ -62,7 +62,8 @@ * 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 @@ { $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; |