Skip to content

Commit e1a0556

Browse files
committed
39854: Fix city name validation to allow digits, &, ., () characters
1 parent f0fa197 commit e1a0556

File tree

1 file changed

+8
-2
lines changed
  • app/code/Magento/Customer/Model/Validator

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@ class City extends AbstractValidator
2020
*
2121
* \p{L}: Unicode letters.
2222
* \p{M}: Unicode marks (diacritic marks, accents, etc.).
23-
* ': Apostrophe mark.
23+
* \d: Digits (0-9).
2424
* \s: Whitespace characters (spaces, tabs, newlines, etc.).
25+
* -: Hyphen.
26+
* ': Apostrophe mark.
27+
* .: Period/full stop.
28+
* ,: Comma.
29+
* &: Ampersand.
30+
* (): Parentheses.
2531
*/
26-
private const PATTERN_CITY = '/(?:[\p{L}\p{M}\s\-\']{1,100})/u';
32+
private const PATTERN_CITY = '/^[\p{L}\p{M}\d\s\-\'\.,&\(\)]{1,100}$/u';
2733

2834
/**
2935
* Validate city fields.

0 commit comments

Comments
 (0)