Skip to content

Commit 9c3e777

Browse files
committed
ACP2E-785: [Premier] List of restricted characters that can be used in Name text fields
1 parent b092dd6 commit 9c3e777

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
@@ -81,6 +81,12 @@ public function expectedPunctuationInNamesDataProvider(): array
8181
'middleName' => '',
8282
'lastNameName' => 'O\'Doe',
8383
'message' => 'Legacy straight apostrophe must be allowed in names'
84+
],
85+
[
86+
'firstName' => 'John',
87+
'middleName' => '',
88+
'lastNameName' => 'O`Doe',
89+
'message' => 'Grave accent back quote character must be allowed in names'
8490
]
8591
];
8692
}

0 commit comments

Comments
 (0)