Skip to content

Commit 026da5a

Browse files
committed
MAGEWTO-7640: X-Magento-Tags header containing whitespaces causes exception
1 parent 08f0056 commit 026da5a

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

lib/internal/Magento/Framework/Config/Converter/Dom/Flat.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ public function convert(\DOMNode $source, $basePath = '')
102102
}
103103
} else {
104104
if ($result) {
105-
$result['value'] = $value;
105+
$result['value'] = trim($value);
106106
} else {
107-
$result = $value;
107+
$result = trim($value);
108108
}
109109
}
110110
return $result;

lib/internal/Magento/Framework/Config/Test/Unit/_files/converter/dom/flat/result.php

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
// @codingStandardsIgnoreFile
67
return [
78
'root' => [
89
'node_one' => [
@@ -11,14 +12,20 @@
1112
'subnode' => [
1213
['attributeThree' => '30'],
1314
['attributeThree' => '40', 'attributeFour' => '40', 'value' => 'Value1'],
15+
['attributeThree' => '50', 'value' => 'value_from_new_line'],
16+
['attributeThree' => '60', 'value' => 'auto_formatted_by_ide_value_due_to_line_size_restriction']
1417
],
1518
'books' => ['attributeFive' => '50'],
1619
],
1720
'multipleNode' => [
1821
'one' => ['id' => 'one', 'name' => 'name1', 'value' => '1'],
1922
'two' => ['id' => 'two', 'name' => 'name2', 'value' => '2'],
23+
'three' => ['id' => 'three', 'name' => 'name3', 'value' => 'value_from_new_line'],
24+
'four' => ['id' => 'four', 'name' => 'name4', 'value' => 'auto_formatted_by_ide_value_due_to_line_size_restriction'],
2025
],
2126
'someOtherVal' => '',
2227
'someDataVal' => '',
28+
'valueFromNewLine' => 'value_from_new_line',
29+
'autoFormattedValue' => 'auto_formatted_by_ide_value_due_to_line_size_restriction'
2330
]
2431
];

lib/internal/Magento/Framework/Config/Test/Unit/_files/converter/dom/flat/source.xml

+19
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
<node_one attributeOne = '10' attributeTwo = '20'>
1010
<subnode attributeThree = '30'></subnode>
1111
<subnode attributeThree = '40' attributeFour = '40' >Value1</subnode>
12+
<subnode attributeThree = '50'>
13+
value_from_new_line
14+
</subnode>
15+
<subnode attributeThree = '60'>auto_formatted_by_ide_value_due_to_line_size_restriction
16+
</subnode>
1217
<books attributeFive = '50' />
1318
</node_one>
1419
<multipleNode id="one" name="name1">
@@ -19,4 +24,18 @@
1924
</multipleNode>
2025
<someOtherVal></someOtherVal>
2126
<someDataVal><![CDATA[]]></someDataVal>
27+
<multipleNode id="three" name="name3">
28+
<value>
29+
value_from_new_line
30+
</value>
31+
</multipleNode>
32+
<multipleNode id="four" name="name4">
33+
<value>auto_formatted_by_ide_value_due_to_line_size_restriction
34+
</value>
35+
</multipleNode>
36+
<valueFromNewLine>
37+
value_from_new_line
38+
</valueFromNewLine>
39+
<autoFormattedValue>auto_formatted_by_ide_value_due_to_line_size_restriction
40+
</autoFormattedValue>
2241
</root>

0 commit comments

Comments
 (0)