From a86d9cd5aa19694b2a99c5971359e46731503e4b Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 24 Oct 2018 11:17:02 +0200 Subject: [PATCH] Fix so unicode in local part of the email address is also supported in recipient inputs (#6490) Relax javascript email address checker. --- CHANGELOG | 1 + program/js/common.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 103bc6770..399f1449f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -17,6 +17,7 @@ CHANGELOG Roundcube Webmail - Elastic: Improved UX of search dialogs (#6416) - Elastic: Fix unwanted thread expanding when selecting a collapsed thread in non-mobile mode (#6445) - Log errors caused by low pcre.backtrack_limit when sending a mail message (#6433) +- Fix so unicode in local part of the email address is also supported in recipient inputs (#6490) - Fix bug where autocomplete list could be displayed out of screen (#6469) - Fix style/navigation on error page depending on authentication state (#6362) - Fix so invalid smtp_helo_host is never used, fallback to localhost (#6408) diff --git a/program/js/common.js b/program/js/common.js index 406ca23a4..1422042ad 100644 --- a/program/js/common.js +++ b/program/js/common.js @@ -402,7 +402,7 @@ triggerEvent: function(evt, e) // check if input is a valid email address // By Cal Henderson // http://code.iamcal.com/php/rfc822/ -function rcube_check_email(input, inline, count) +function rcube_check_email(input, inline, count, strict) { if (!input) return count ? 0 : false; @@ -438,7 +438,7 @@ function rcube_check_email(input, inline, count) '\\u05d1\\u05f2\\u05b7\\u05e9\\u05e4\\u05bc\\u05d9\\u05dc\\x2e\\u05d8\\u05e2\\u05e1\\u05d8' ], icann_addr = 'mailtest\\x40('+icann_domains.join('|')+')', - word = '('+atom+'|'+quoted_string+')', + word = strict ? '('+atom+'|'+quoted_string+')' : '[^\\u0000-\\u0020\\u002e\\u00a0\\u0040\\u007f\\u2028\\u2029]+', delim = '[,;\\s\\n]', local_part = word+'(\\x2e'+word+')*', addr_spec = '(('+local_part+'\\x40'+domain+')|('+icann_addr+'))',