Skip to content

Commit b5c81ad

Browse files
committed
Merge remote-tracking branch 'origin/MC-17505' into 2.3-develop-pr26
2 parents 9654528 + 01b8305 commit b5c81ad

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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($value);
171+
$result = $this->_validateInputRule(trim($value));
172172
return \is_array($result) ? $result : [];
173173
}
174174
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use Magento\Framework\Exception\LocalizedException;
1010
use Magento\Framework\Stdlib\StringUtils;
1111

12+
/**
13+
* Eav text attribute model test
14+
*/
1215
class TextTest extends \PHPUnit\Framework\TestCase
1316
{
1417
/**
@@ -135,6 +138,7 @@ public function alphanumDataProvider(): array
135138
['QazWsx12345', [
136139
__('"%1" length must be equal or less than %2 characters.', 'Test', 10)]
137140
],
141+
[' 12345 ', true],
138142
];
139143
}
140144

0 commit comments

Comments
 (0)