Skip to content

Commit 18c39ce

Browse files
committed
Merge remote-tracking branch '33470/fix-validate-emails-rule' into commpr-10131-2907
2 parents 3d20a0f + eab5e9b commit 18c39ce

File tree

1 file changed

+6
-4
lines changed
  • app/code/Magento/Ui/view/base/web/js/lib/validation

1 file changed

+6
-4
lines changed

app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/**
2-
* Copyright © Magento, Inc. All rights reserved.
3-
* See COPYING.txt for license details.
2+
* Copyright 2014 Adobe
3+
* All Rights Reserved.
44
*/
55
/* eslint-disable no-useless-escape */
66
// jscs:disable no-useless-escape
77
/**
88
* @api
99
*/
10+
11+
/* eslint-disable no-useless-escape */
1012
define([
1113
'jquery',
1214
'underscore',
@@ -893,11 +895,11 @@ define([
893895
if (utils.isEmpty(value)) {
894896
return true;
895897
}
896-
validRegexp = /^[a-z0-9\._-]{1,30}@([a-z0-9_-]{1,30}\.){1,5}[a-z]{2,4}$/i;
898+
validRegexp = /^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i; //eslint-disable-line max-len
897899
emails = value.split(/[\s\n\,]+/g);
898900

899901
for (i = 0; i < emails.length; i++) {
900-
if (!validRegexp.test(emails[i].strip())) {
902+
if (!validRegexp.test(emails[i].trim())) {
901903
return false;
902904
}
903905
}

0 commit comments

Comments
 (0)