We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd09734 commit 3bade65Copy full SHA for 3bade65
app/code/Magento/Customer/Model/Validator/Name.php
@@ -15,6 +15,8 @@
15
*/
16
class Name extends AbstractValidator
17
{
18
+ const PATTERN_NAME = '/(?:[\p{L}\p{M}\,\-\_\.\'\s\d]){1,255}+/u';
19
+
20
/**
21
* Validate name fields.
22
*
@@ -47,8 +49,7 @@ public function isValid($customer)
47
49
private function isValidName($nameValue)
48
50
51
if ($nameValue != null) {
- $pattern = '/(?:[\p{L}\p{M}\,\-\_\.\'\"\s\d]){1,255}+/u';
- if (preg_match($pattern, $nameValue, $matches)) {
52
+ if (preg_match(self::PATTERN_NAME, $nameValue, $matches)) {
53
return $matches[0] == $nameValue;
54
}
55
0 commit comments