Skip to content

Commit e799b73

Browse files
author
Viktor Tymchynskyi
committed
Merge remote-tracking branch 'origin/MAGETWO-38417' into develop
2 parents 9523463 + c0770fd commit e799b73

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,10 +645,16 @@ public function fileWrite($resource, $data)
645645
public function filePutCsv($resource, array $data, $delimiter = ',', $enclosure = '"')
646646
{
647647
/**
648-
* Security enhancement for CSV data processing by Excel-like applications.
649-
* @see https://bugzilla.mozilla.org/show_bug.cgi?id=1054702
650-
*/
648+
* Security enhancement for CSV data processing by Excel-like applications.
649+
* @see https://bugzilla.mozilla.org/show_bug.cgi?id=1054702
650+
*
651+
* @var $value string|\Magento\Framework\Phrase
652+
*/
651653
foreach ($data as $key => $value) {
654+
655+
if (!is_string($value)) {
656+
$value = (string)$value;
657+
}
652658
if (isset($value[0]) && $value[0] === '=') {
653659
$data[$key] = ' ' . $value;
654660
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,13 @@ public function streamWriteCsv(array $row, $delimiter = ',', $enclosure = '"')
180180
/**
181181
* Security enhancement for CSV data processing by Excel-like applications.
182182
* @see https://bugzilla.mozilla.org/show_bug.cgi?id=1054702
183+
*
184+
* @var $value string|\Magento\Framework\Phrase
183185
*/
184186
foreach ($row as $key => $value) {
187+
if (!is_string($value)) {
188+
$value = (string)$value;
189+
}
185190
if (isset($value[0]) && $value[0] === '=') {
186191
$row[$key] = ' ' . $value;
187192
}

0 commit comments

Comments
 (0)