Skip to content

Commit 72b3991

Browse files
Merge forwardport of #12507 to 2.3-develop branch
Applied pull request patch https://github.com/magento/magento2/pull/12507.patch (created by @PascalBrouwers) based on commit(s): 1. 9c5420f 2. daee4a8 Fixed GitHub Issues in 2.3-develop branch: - #12506: Fixup typo getDispretionPath -> getDispersionPath (reported by @PascalBrouwers)
2 parents 8e77e2f + 21cfb6a commit 72b3991

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

app/code/Magento/Catalog/Model/Product/Gallery/Processor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function addImage(
149149
}
150150

151151
$fileName = \Magento\MediaStorage\Model\File\Uploader::getCorrectFileName($pathinfo['basename']);
152-
$dispretionPath = \Magento\MediaStorage\Model\File\Uploader::getDispretionPath($fileName);
152+
$dispretionPath = \Magento\MediaStorage\Model\File\Uploader::getDispersionPath($fileName);
153153
$fileName = $dispretionPath . '/' . $fileName;
154154

155155
$fileName = $this->getNotDuplicatedFilename($fileName, $dispretionPath);

app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function validate($processingParams, $option)
150150
$extension = pathinfo(strtolower($fileInfo['name']), PATHINFO_EXTENSION);
151151

152152
$fileName = \Magento\MediaStorage\Model\File\Uploader::getCorrectFileName($fileInfo['name']);
153-
$dispersion = \Magento\MediaStorage\Model\File\Uploader::getDispretionPath($fileName);
153+
$dispersion = \Magento\MediaStorage\Model\File\Uploader::getDispersionPath($fileName);
154154

155155
$filePath = $dispersion;
156156

app/code/Magento/Customer/Model/FileProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function moveTemporaryFile($fileName)
202202
{
203203
$fileName = ltrim($fileName, '/');
204204

205-
$dispersionPath = \Magento\MediaStorage\Model\File\Uploader::getDispretionPath($fileName);
205+
$dispersionPath = \Magento\MediaStorage\Model\File\Uploader::getDispersionPath($fileName);
206206
$destinationPath = $this->entityTypeCode . $dispersionPath;
207207

208208
if (!$this->mediaDirectory->create($destinationPath)) {

app/code/Magento/ProductVideo/Controller/Adminhtml/Product/Gallery/RetrieveImage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function execute()
110110
$remoteFileUrl = $this->getRequest()->getParam('remote_image');
111111
$this->validateRemoteFile($remoteFileUrl);
112112
$localFileName = Uploader::getCorrectFileName(basename($remoteFileUrl));
113-
$localTmpFileName = Uploader::getDispretionPath($localFileName) . DIRECTORY_SEPARATOR . $localFileName;
113+
$localTmpFileName = Uploader::getDispersionPath($localFileName) . DIRECTORY_SEPARATOR . $localFileName;
114114
$localFilePath = $baseTmpMediaPath . ($localTmpFileName);
115115
$localUniqFilePath = $this->appendNewFileName($localFilePath);
116116
$this->validateRemoteFileExtensions($localUniqFilePath);
@@ -174,7 +174,7 @@ private function validateRemoteFileExtensions($filePath)
174174
protected function appendResultSaveRemoteImage($fileName)
175175
{
176176
$fileInfo = pathinfo($fileName);
177-
$tmpFileName = Uploader::getDispretionPath($fileInfo['basename']) . DIRECTORY_SEPARATOR . $fileInfo['basename'];
177+
$tmpFileName = Uploader::getDispersionPath($fileInfo['basename']) . DIRECTORY_SEPARATOR . $fileInfo['basename'];
178178
$result['name'] = $fileInfo['basename'];
179179
$result['type'] = $this->imageAdapter->getMimeType();
180180
$result['error'] = 0;

lib/internal/Magento/Framework/File/Uploader.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function save($destinationFolder, $newFileName = null)
201201
if ($this->_enableFilesDispersion) {
202202
$fileName = $this->correctFileNameCase($fileName);
203203
$this->setAllowCreateFolders(true);
204-
$this->_dispretionPath = self::getDispretionPath($fileName);
204+
$this->_dispretionPath = self::getDispersionPath($fileName);
205205
$destinationFile .= $this->_dispretionPath;
206206
$this->_createDestinationFolder($destinationFile);
207207
}
@@ -610,8 +610,20 @@ public static function getNewFileName($destinationFile)
610610
*
611611
* @param string $fileName
612612
* @return string
613+
* @deprecated
613614
*/
614615
public static function getDispretionPath($fileName)
616+
{
617+
return self::getDispersionPath($fileName);
618+
}
619+
620+
/**
621+
* Get dispertion path
622+
*
623+
* @param string $fileName
624+
* @return string
625+
*/
626+
public static function getDispersionPath($fileName)
615627
{
616628
$char = 0;
617629
$dispertionPath = '';

0 commit comments

Comments
 (0)