Skip to content

Commit c519629

Browse files
committed
Merge remote-tracking branch 'magento-l3/ACP2E-103' into L3_PR_21-12-10
2 parents c35e873 + c22d981 commit c519629

File tree

1 file changed

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

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,22 @@ define([
11011101
return moment.utc(value, params.dateFormat).isSameOrBefore(moment.utc());
11021102
},
11031103
$.mage.__('The Date of Birth should not be greater than today.')
1104+
],
1105+
'validate-no-utf8mb4-characters': [
1106+
function (value) {
1107+
var validator = this,
1108+
message = $.mage.__('Please remove invalid characters: {0}.'),
1109+
matches = value.match(/(?:[\uD800-\uDBFF][\uDC00-\uDFFF])/g),
1110+
result = matches === null;
1111+
1112+
if (!result) {
1113+
validator.charErrorMessage = message.replace('{0}', matches.join());
1114+
}
1115+
1116+
return result;
1117+
}, function () {
1118+
return this.charErrorMessage;
1119+
}
11041120
]
11051121
}, function (data) {
11061122
return {

0 commit comments

Comments
 (0)