diff --git a/api/js/etemplate/et2_widget_url.js b/api/js/etemplate/et2_widget_url.js index 65c8becb6f..ffa5d6dd51 100644 --- a/api/js/etemplate/et2_widget_url.js +++ b/api/js/etemplate/et2_widget_url.js @@ -41,12 +41,14 @@ var et2_url = (function(){ "use strict"; return et2_textbox.extend( * - "Becker < Ralf " (contains < ----------- " ---------------) * * About umlaut or IDN domains: we currently only allow German umlauts in domain part! + * We forbid all non-ascii chars in local part, as Horde does not yet support SMTPUTF8 extension (rfc6531) + * and we get a "SMTP server does not support internationalized header data" error otherwise. * * Using \042 instead of " to NOT stall minifyer! * * Same preg is in Etemplate\Widget\Url PHP class! */ - EMAIL_PREG: new RegExp(/^(([^\042',<][^,<]+|\042[^\042]+\042|\'[^\']+\'|)\s?<)?[^\x00-\x20()<>@,;:\042\[\]]+@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,}>?$/i), + EMAIL_PREG: new RegExp(/^(([^\042',<][^,<]+|\042[^\042]+\042|\'[^\']+\'|)\s?<)?[^\x00-\x20()<>@,;:\042\[\]\x80-\xff]+@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,}>?$/i), /** * @memberOf et2_url */ diff --git a/api/src/Etemplate/Widget/Url.php b/api/src/Etemplate/Widget/Url.php index 7b532efb5b..25dd76a1f7 100644 --- a/api/src/Etemplate/Widget/Url.php +++ b/api/src/Etemplate/Widget/Url.php @@ -35,10 +35,12 @@ class Url extends Etemplate\Widget * - ToDo: "\u200Bfrancesca.klein@ikem.de" (starts with a "zero width space") * * About umlaut or IDN domains: we currently only allow German umlauts in domain part! + * We forbid all non-ascii chars in local part, as Horde does not yet support SMTPUTF8 extension (rfc6531) + * and we get a "SMTP server does not support internationalized header data" error otherwise. * * Same preg is in et2_widget_url Javascript class, but no \x00 allowed and /u modifier for utf8! */ - const EMAIL_PREG = "/^(([^\042',<][^,<]+|\042[^\042]+\042|\'[^\']+\'|)\s?<)?[^\x01-\x20()<>@,;:\042\[\]]+@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,}>?$/iu"; + const EMAIL_PREG = "/^(([^\042',<][^,<]+|\042[^\042]+\042|\'[^\']+\'|)\s?<)?[^\x01-\x20()<>@,;:\042\[\]\x80-\xff]+@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,}>?$/iu"; /** * Validate input