Skip to content

Commit 5229bd0

Browse files
authored
Merge branch '2.4-develop' into AC-15165-updated
2 parents 2ac07ec + b9f5d6f commit 5229bd0

File tree

5 files changed

+62
-17
lines changed

5 files changed

+62
-17
lines changed

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2024 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -20,10 +20,17 @@ 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+
* _: Underscore.
27+
* ', ’: Apostrophes (straight and typographical).
28+
* .: Period/full stop.
29+
* ,: Comma.
30+
* &: Ampersand.
31+
* (): Parentheses.
2532
*/
26-
private const PATTERN_CITY = '/(?:[\p{L}\p{M}\s\-\']{1,100})/u';
33+
private const PATTERN_CITY = '/^[\p{L}\p{M}\d\s\-_\'’\.,&\(\)]{1,100}$/u';
2734

2835
/**
2936
* Validate city fields.
@@ -35,7 +42,8 @@ public function isValid($customer)
3542
{
3643
if (!$this->isValidCity($customer->getCity())) {
3744
parent::_addMessages([[
38-
'city' => "Invalid City. Please use A-Z, a-z, 0-9, -, ', spaces"
45+
'city' => "Invalid City. Please use letters, numbers, spaces,
46+
and the following characters: - _ ' ’ . , & ( )"
3947
]]);
4048
}
4149

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

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2024 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -79,6 +79,38 @@ public static function expectedPunctuationInNamesDataProvider(): array
7979
[
8080
'city' => ' Moscow Moscow',
8181
'message' => 'Whitespace characters must be allowed in city'
82+
],
83+
[
84+
'city' => 'O\'Higgins',
85+
'message' => 'Straight apostrophe must be allowed in city names'
86+
],
87+
[
88+
'city' => 'O’Higgins',
89+
'message' => 'Typographical apostrophe must be allowed in city names'
90+
],
91+
[
92+
'city' => 'Saint_Petersburg',
93+
'message' => 'Underscore must be allowed in city names'
94+
],
95+
[
96+
'city' => 'Stratford-upon-Avon',
97+
'message' => 'Hyphens must be allowed in city names'
98+
],
99+
[
100+
'city' => 'St. Petersburg',
101+
'message' => 'Periods must be allowed in city names'
102+
],
103+
[
104+
'city' => 'Trinidad & Tobago',
105+
'message' => 'Ampersand must be allowed in city names'
106+
],
107+
[
108+
'city' => 'Winston-Salem (NC)',
109+
'message' => 'Parentheses must be allowed in city names'
110+
],
111+
[
112+
'city' => 'Rostov-on-Don, Russia',
113+
'message' => 'Commas must be allowed in city names'
82114
]
83115
];
84116
}

app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_shipping.less

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// /**
2-
// * Copyright © Magento, Inc. All rights reserved.
3-
// * See COPYING.txt for license details.
4-
// */
1+
/**
2+
* Copyright 2015 Adobe
3+
* All Rights Reserved.
4+
*/
55

66
//
77
// Variables
@@ -32,7 +32,7 @@
3232
@checkout-shipping-item-mobile__active__padding: 15px (@indent__l + 5px) 15px 18px;
3333

3434
@checkout-shipping-item-before__border-color: @color-gray80;
35-
@checkout-shipping-item-before__height: calc(~'100% - 20px');
35+
@checkout-shipping-item-before__height: ~"calc(100% - 20px)";
3636

3737
@checkout-shipping-method__border: @checkout-step-title__border;
3838
@checkout-shipping-method__padding: @indent__base;

app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_shipping.less

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// /**
2-
// * Copyright © Magento, Inc. All rights reserved.
3-
// * See COPYING.txt for license details.
4-
// */
1+
/**
2+
* Copyright 2015 Adobe
3+
* All Rights Reserved.
4+
*/
55

66
//
77
// Variables
@@ -32,7 +32,7 @@
3232
@checkout-shipping-item-mobile__active__padding: 15px (@indent__l + 5px) 15px 18px;
3333

3434
@checkout-shipping-item-before__border-color: @color-gray80;
35-
@checkout-shipping-item-before__height: calc(~'100% - 20px');
35+
@checkout-shipping-item-before__height: ~"calc(100% - 20px)";
3636

3737
@checkout-shipping-method__border: @checkout-step-title__border;
3838
@checkout-shipping-method__padding: @indent__base;

lib/web/css/source/lib/_responsive.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@
7474
.media-width('max', @screen__l);
7575
}
7676

77+
@media all and (min-width: (@screen__l)),
78+
print {
79+
.media-width('min', @screen__l);
80+
}
81+
7782
@media all and (min-width: @screen__xl),
7883
print {
7984
.media-width('min', @screen__xl);

0 commit comments

Comments
 (0)