File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
app/code/Magento/Ui/view/base/web/js/lib/validation Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1101,6 +1101,22 @@ define([
1101
1101
return moment . utc ( value , params . dateFormat ) . isSameOrBefore ( moment . utc ( ) ) ;
1102
1102
} ,
1103
1103
$ . 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
+ }
1104
1120
]
1105
1121
} , function ( data ) {
1106
1122
return {
You can’t perform that action at this time.
0 commit comments