Skip to content

Commit 27b0912

Browse files
committed
MC-13954: Update Product Import Temp Directory
1 parent 675ccdb commit 27b0912

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Uploader.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* @api
1616
* @since 100.0.2
1717
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
18+
* phpcs:disable Magento2.Functions.DiscouragedFunction
1819
*/
1920
class Uploader extends \Magento\MediaStorage\Model\File\Uploader
2021
{
@@ -282,7 +283,7 @@ protected function _validateFile()
282283

283284
$fileExtension = pathinfo($filePath, PATHINFO_EXTENSION);
284285
if (!$this->checkAllowedExtension($fileExtension)) {
285-
throw new \Exception('Disallowed file type.');
286+
throw new \Magento\Framework\Exception\LocalizedException('Disallowed file type.');
286287
}
287288
//run validate callbacks
288289
foreach ($this->_validateCallbacks as $params) {
@@ -386,6 +387,7 @@ protected function _moveFile($tmpPath, $destPath)
386387
*/
387388
protected function chmod($file)
388389
{
390+
//phpcs:ignore Squiz.PHP.NonExecutableCode.ReturnNotRequired
389391
return;
390392
}
391393
}

app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/UploaderTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
*/
77
namespace Magento\CatalogImportExport\Test\Unit\Model\Import;
88

9+
/**
10+
* Class UploaderTest
11+
*
12+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
13+
*/
914
class UploaderTest extends \PHPUnit\Framework\TestCase
1015
{
1116
/**

0 commit comments

Comments
 (0)