Skip to content

Commit 39cb0b9

Browse files
author
Korshenko, Olexii(okorshenko)
committed
Merge pull request #136 from magento-nord/develop
MAGETWO-37209: Excel Formula Injection via CSV/XML export - 2.x
2 parents 3d3497a + dc2c27b commit 39cb0b9

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ define([
77
"jquery/ui",
88
"mage/translate",
99
"prototype",
10-
'Magento_Ui/js/modal/modal'
10+
"Magento_Ui/js/modal/modal"
1111
], function(jQuery){
1212

1313
window.ProductConfigure = Class.create();
@@ -764,4 +764,4 @@ define([
764764
};
765765

766766
productConfigure = new ProductConfigure();
767-
});
767+
});

app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
</referenceBlock>
2222
<referenceContainer name="after.body.start">
2323
<block class="Magento\Backend\Block\Template" name="optional_zip_countries" as="optional_zip_countries" template="Magento_Directory::js/optional_zip_countries.phtml"/>
24+
<block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Configure" template="Magento_Catalog::catalog/product/composite/configure.phtml"/>
2425
</referenceContainer>
2526
<referenceContainer name="js">
2627
<block class="Magento\Backend\Block\Template" template="Magento_Sales::order/create/js.phtml" name="create"/>
@@ -75,8 +76,5 @@
7576
</block>
7677
</block>
7778
</referenceBlock>
78-
<referenceContainer name="before.body.end">
79-
<block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Configure" template="Magento_Catalog::catalog/product/composite/configure.phtml"/>
80-
</referenceContainer>
8179
</body>
8280
</page>

lib/internal/Magento/Framework/Filesystem/Driver/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ public function filePutCsv($resource, array $data, $delimiter = ',', $enclosure
710710
if (!is_string($value)) {
711711
$value = (string)$value;
712712
}
713-
if (isset($value[0]) && $value[0] === '=') {
713+
if (isset($value[0]) && in_array($value[0], ['=', '+', '-'])) {
714714
$data[$key] = ' ' . $value;
715715
}
716716
}

lib/internal/Magento/Framework/Filesystem/Io/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function streamWriteCsv(array $row, $delimiter = ',', $enclosure = '"')
190190
if (!is_string($value)) {
191191
$value = (string)$value;
192192
}
193-
if (isset($value[0]) && $value[0] === '=') {
193+
if (isset($value[0]) && in_array($value[0], ['=', '+', '-'])) {
194194
$row[$key] = ' ' . $value;
195195
}
196196
}

0 commit comments

Comments
 (0)