Skip to content

Commit e09f594

Browse files
SarmisthaSarmistha
authored andcommitted
ACP2E-2511: [Cloud] Special characters cannot be used in name fields
1 parent 2f5faa7 commit e09f594

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

app/code/Magento/Customer/Model/Validator/Name.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
class Name extends AbstractValidator
1717
{
18-
private const PATTERN_NAME = '/(?:[\p{L}\p{M}\,\-\_\.\'’`\s\d]){1,255}+/u';
18+
private const PATTERN_NAME = '/(?:[\p{L}\p{M}\,\-\_\.\'’`&\s\d]){1,255}+/u';
1919

2020
/**
2121
* Validate name fields.

app/code/Magento/Customer/Test/Unit/Model/Validator/NameTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ public function expectedPunctuationInNamesDataProvider(): array
8787
'middleName' => '',
8888
'lastNameName' => 'O`Doe',
8989
'message' => 'Grave accent back quote character must be allowed in names'
90+
],
91+
[
92+
'firstName' => 'John & Smith',
93+
'middleName' => '',
94+
'lastNameName' => 'O`Doe',
95+
'message' => 'Special character ampersand(&) must be allowed in names'
9096
]
9197
];
9298
}

0 commit comments

Comments
 (0)