Skip to content

Commit 2fcb0f9

Browse files
authored
Merge pull request #4397 from magento-obsessive-owls/owls-2.2.10-delivery
[owls] MC-17485, MC-17582
2 parents 5d94631 + d249204 commit 2fcb0f9

File tree

3 files changed

+22
-4
lines changed
  • app/code/Magento
  • lib/internal/Magento/Framework/Archive

3 files changed

+22
-4
lines changed

app/code/Magento/Catalog/Model/Product/AttributeSet/Options.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55
*/
66
namespace Magento\Catalog\Model\Product\AttributeSet;
77

8+
/**
9+
* Attribute Set Options
10+
*/
811
class Options implements \Magento\Framework\Data\OptionSourceInterface
912
{
1013
/**
11-
* @var null|array
14+
* @var array
1215
*/
1316
protected $options;
1417

@@ -25,15 +28,23 @@ public function __construct(
2528
}
2629

2730
/**
28-
* @return array|null
31+
* @inheritDoc
2932
*/
3033
public function toOptionArray()
3134
{
3235
if (null == $this->options) {
3336
$this->options = $this->collectionFactory->create()
3437
->setEntityTypeFilter($this->product->getTypeId())
3538
->toOptionArray();
39+
40+
array_walk(
41+
$this->options,
42+
function (&$option) {
43+
$option['__disableTmpl'] = true;
44+
}
45+
);
3646
}
47+
3748
return $this->options;
3849
}
3950
}

app/code/Magento/ImportExport/Model/Import/Source/Zip.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ public function __construct(
3232
throw new ValidatorException(__('Sorry, but the data is invalid or the file is not uploaded.'));
3333
}
3434
$directory->delete($directory->getRelativePath($file));
35-
parent::__construct($csvFile, $directory, $options);
35+
36+
try {
37+
parent::__construct($csvFile, $directory, $options);
38+
} catch (\LogicException $e) {
39+
$directory->delete($directory->getRelativePath($csvFile));
40+
throw $e;
41+
}
3642
}
3743
}

lib/internal/Magento/Framework/Archive/Zip.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ public function unpack($source, $destination)
5454
$zip = new \ZipArchive();
5555
if ($zip->open($source) === true) {
5656
$filename = $this->filterRelativePaths($zip->getNameIndex(0) ?: '');
57-
if ($filename) {
57+
if ($filename && !preg_match('#[:"*?|<>%]#', $filename)) {
58+
// extract first entry in zip file to destination directory
5859
$zip->extractTo(dirname($destination), $filename);
5960
rename(dirname($destination).'/'.$filename, $destination);
6061
} else {

0 commit comments

Comments
 (0)