Skip to content

Commit

Permalink
Issue 12506: Fixup typo getDispretionPath -> getDispersionPath
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalBrouwers committed Dec 1, 2017
1 parent 82caf48 commit 9c5420f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function addImage(
}

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

$fileName = $this->getNotDuplicatedFilename($fileName, $dispretionPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function validate($processingParams, $option)
$extension = pathinfo(strtolower($fileInfo['name']), PATHINFO_EXTENSION);

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

$filePath = $dispersion;

Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Customer/Model/FileProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function moveTemporaryFile($fileName)
{
$fileName = ltrim($fileName, '/');

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

if (!$this->mediaDirectory->create($destinationPath)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function execute()
$remoteFileUrl = $this->getRequest()->getParam('remote_image');
$this->validateRemoteFile($remoteFileUrl);
$localFileName = Uploader::getCorrectFileName(basename($remoteFileUrl));
$localTmpFileName = Uploader::getDispretionPath($localFileName) . DIRECTORY_SEPARATOR . $localFileName;
$localTmpFileName = Uploader::getDispersionPath($localFileName) . DIRECTORY_SEPARATOR . $localFileName;
$localFilePath = $baseTmpMediaPath . ($localTmpFileName);
$localUniqFilePath = $this->appendNewFileName($localFilePath);
$this->validateRemoteFileExtensions($localUniqFilePath);
Expand Down Expand Up @@ -174,7 +174,7 @@ private function validateRemoteFileExtensions($filePath)
protected function appendResultSaveRemoteImage($fileName)
{
$fileInfo = pathinfo($fileName);
$tmpFileName = Uploader::getDispretionPath($fileInfo['basename']) . DIRECTORY_SEPARATOR . $fileInfo['basename'];
$tmpFileName = Uploader::getDispersionPath($fileInfo['basename']) . DIRECTORY_SEPARATOR . $fileInfo['basename'];
$result['name'] = $fileInfo['basename'];
$result['type'] = $this->imageAdapter->getMimeType();
$result['error'] = 0;
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/Magento/Framework/File/Uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function save($destinationFolder, $newFileName = null)
if ($this->_enableFilesDispersion) {
$fileName = $this->correctFileNameCase($fileName);
$this->setAllowCreateFolders(true);
$this->_dispretionPath = self::getDispretionPath($fileName);
$this->_dispretionPath = self::getDispersionPath($fileName);
$destinationFile .= $this->_dispretionPath;
$this->_createDestinationFolder($destinationFile);
}
Expand Down Expand Up @@ -611,7 +611,7 @@ public static function getNewFileName($destinationFile)
* @param string $fileName
* @return string
*/
public static function getDispretionPath($fileName)
public static function getDispersionPath($fileName)
{
$char = 0;
$dispertionPath = '';
Expand Down

0 comments on commit 9c5420f

Please sign in to comment.