Skip to content

Commit dbe4f9f

Browse files
MC-17925: Customer address attribute Phone validation issue
1 parent f94b4a8 commit dbe4f9f

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

app/code/Magento/Customer/Model/Data/Address.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function getCompany()
119119
*/
120120
public function getTelephone()
121121
{
122-
return $this->_get(self::TELEPHONE);
122+
return trim($this->_get(self::TELEPHONE));
123123
}
124124

125125
/**

app/code/Magento/Eav/Model/Attribute/Data/Text.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(
4545
*/
4646
public function extractValue(RequestInterface $request)
4747
{
48-
$value = $this->_getRequestValue($request);
48+
$value = trim($this->_getRequestValue($request));
4949
return $this->_applyInputFilter($value);
5050
}
5151

@@ -168,7 +168,7 @@ private function validateLength(\Magento\Eav\Model\Attribute $attribute, string
168168
*/
169169
private function validateInputRule(string $value): array
170170
{
171-
$result = $this->_validateInputRule(trim($value));
171+
$result = $this->_validateInputRule($value);
172172
return \is_array($result) ? $result : [];
173173
}
174174
}

app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/TextTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ public function alphanumDataProvider(): array
138138
['QazWsx12345', [
139139
__('"%1" length must be equal or less than %2 characters.', 'Test', 10)]
140140
],
141-
[' 12345 ', true],
142141
];
143142
}
144143

0 commit comments

Comments
 (0)